i am trying to make a zenity shell menu to manage 50+ servers and want to add multiple customized functions. e.g:- when server goes down i want to ssh in it, then check load,free -m, last 10 mins apache/nginx logs,exim logs,mysql slow query logs and many more. i have scripts for all these needs.
those servers have my ssh key so theres no problm in doing ssh.
i am successfully logging in servers, but the thing is when i get into server via ssh, the script ends and after i exit for server, i comes on my local machine's terminal with no script, then i have to again run script to get server menu. Please tell me how can i stay in loop i mean how to stay in server menu , then ssh into any server, and when i exit from server come back to server menu. please help . i want to customize it more.
=========== its short script to give you guys idea. my origial script have all servers======
#!/bin/bash dialog --menu "select" 40 40 5 1 server.hades 2 server.fire 3 server.geb 4 server.isis 5 exit 2> /tmp/a choice=`cat /tmp/a` if [ $choice -eq 1 ] then ssh 18.104.22.168 fi if [ $choice -eq 2 ] then ssh 22.214.171.124 fi if [ $choice -eq 3 ] then ssh 126.96.36.199 fi if [ $choice -eq 4 ] then ssh 188.8.131.52 fi if [ $choice -eq 5 ] then echo "BIE BIE" fi