I am making a script that first runs a command on a server and stores the response from server to a file (>>output.txt); now, next, the script will read the Output.txt file and see if x=0 and use it as a condition to if/else.
For example, my script will check server replication status & will update output.txt file with below line: x=0 (if replication complete) x=any number (if there is some data yet to get replicated) (We don't know the number of line where the value to x will be stored in output.txt as the script will keep updating the file & we need to read the last line always)
Now, I want my script to read the output.txt file and if x=0, it will shutdown the server, else not.
Thanks for every help :)
Aucun commentaire:
Enregistrer un commentaire