I am a junior sys admin. Reason I'm asking this question is because we don't have a senior sys-admin here who is proficient with scripting. Senior guys are at the head office and too busy for something like this.
My scenario is this. I have to run a three scripts often, for deploying an application. The scripts were made by a senior sys-admin. Generally things go smoothly with them and no errors. But, I have to babysit them for input. :(
During parts of these scripts, there's parts when I have to enter yes or no. My answers never change, unless the previous part fails, then I select no, and it says 'build failed.'
There's basically these parts that I run:
1 - SSH into a deployment server
2 - edit a small string in an file (which specifies a server specific information)
3 - run script A, which basically scps all the files from the deployment to the target server. The only input I have to give here, is at the end. It asks if the correct date is shown from the target, if I say yes, the build is successful.
4 - run script B also from deployment server, which needs some specific information, for example like:
./scriptB X Y Z where X, Y, Z change depend on target server information.
Script B has some questions like 'do you want to do this or drop this', the answers stay the same. Also sometimes there's an ANT bug so it wants me to hit '1' until the script continues.
5 - run script C, which is very similar to script B. At one point though, it is about to run a particular step, and I must manually hit 'control c' to exit out.
I'm a noob at scripting, but if someone could tell me or give me an idea how I could do this that would be great. I thought maybe I could use expect.
Even better, would be if I could just click some EXE on my Windows laptop, and it does everything. Is that even possible?