LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-08-2017, 12:53 PM   #1
Navdeep.D2
LQ Newbie
 
Registered: Dec 2016
Location: India,Punjab
Posts: 8

Rep: Reputation: Disabled
Zenity Shell Menu for 50+ servers, How to stay in server menu ?


Hello,
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. But i am stuck here, please help.
# 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======

Code:
#!/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 1.2.3.4
fi
if [ $choice -eq 2 ]
then
ssh 2.3.4.5
fi
if [ $choice -eq 3 ]
then
ssh 2.3.3.5
fi
if [ $choice -eq 4 ]
then
ssh 8.3.4.8
fi
if [ $choice -eq 5 ]
then
echo "BIE BIE"
fi
 
Old 05-08-2017, 08:41 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,940

Rep: Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780Reputation: 780
Code:
while true
do

some code here
more  code
...
done
 
  


Reply

Tags
shell scripting, ssh, zenity


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
When right/left clicking for a context menu to appear, it display a pitch black menu pupuela Linux - Newbie 4 08-07-2014 06:54 AM
Menu bashed shell script for users shell 0.o Linux - Server 6 02-14-2013 06:00 AM
zenity GUI script not working in menu/panel gnome simon place Linux - Desktop 6 08-31-2010 07:28 AM
Fresh Install Of Distr From Network - Boot Menu, Need to pull up a menu of OS dist to SupermanInNY Linux - Distributions 0 01-22-2006 11:48 AM
Gnome Network Servers Menu Entry Xylon Linux - Networking 2 03-15-2004 11:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration