I have a script that adds user on many server. Since I'm adding on many server(s) I am using for loop.
Below are the output when user is successfully added.
If the user is not added, then I get this error
1,23996,CLI failed to connect to database.
1,22560,The current state of the server does not allow this action.
script Begin read user echo -e '\E[32;40m'"\033[1mPlease wait .... adding id on all server\033[0m" PORT=777 USER=User PASSWORD=**** for server in server1.abc.com server2.abc.com do command // to add user done Script end
I want echo of both user added and user not added based on server list passed for loop.
User added in server1.abc.com user failed to add in server2.abc.com
Any help on this would be highly appreciated.