[Q] Need help writing a simple interactive bash script
Long story short, I have some Nexus 7s and ethernet adapters to go with them and need to configure eth0 with a static IP. I have already written scripts that run and configure eth0 with what we need at the moment. The script basically consists of one line that says "ip addr add 192.168.1.5/24 dev eth0". It works great for what we need.
Every once in awhile we need our team to configure custom IPs on eth0 but these guys are even more noob than me, I've just been opening up Terminal and doing the same command from above but with different IP info by hand.
So my question, Could someone with some bash scripting knowledge give me a tip on how to write an interactive script that asks what IP, Netmask, Gateway then runs it with that IP info? It will probably involve echo commands, but again, I'm a noob and was hoping someone here would be able to help. Just a super simple interaction. Nothing too complex. Thanks in advance, also, if I'm posting this in the wrong forum, let me know. Thanks again.