Link to home
Start Free TrialLog in
Avatar of John Sheehy
John SheehyFlag for United States of America

asked on

Writing a UNIX script menu allowing for multiple options.

I have a shell of a script below that I would like to try out.  These are daily tasks, that if I had a menu, would be much easier.

The hard part I see if passing my credentials from one host machine to the next one. and running commands there.

I am running SOLARIS 10 UNIX.

Thanks
John
Avatar of John Sheehy
John Sheehy
Flag of United States of America image

ASKER

Here is what I have so far:

#!/bin/sh
#
#
while:
do
clear
echo "-----------------------------------------------"
echo " * * * * * * * Main Menu * * * * * * * * * * * "
echo "-----------------------------------------------"
echo "[1] Show Hosts to Audit"
echo "[2] Add Host to Audit List"
echo "[3] Reomve Host from Audit List"
echo "[4] Check if Log Server is running"
echo "[5] Remove Symbolic Link if no Log Server"
echo "[6] Create Symbolic Link if Log Server Exsists"
echo "[7] View Users locked on local machine"
echo "[8] View Users locked on Remotes machines"
echo "[9] Unlock users on local or remote machines"
echo "[10] Update A/V files on local and remote machines"
echo "[11] Perfrom audit requirerments on a new install"
echo "[12] Exit/stop"
echo "----------------------------------------------"
echo -n "Enter your menu choice [1-12]:"
read yourch
case $yourch in
      1) echo "List of Nodes that can be audited are 'more /h/Audit/etc/Nodes' , press a key..." ; read -n1;;
      2)
      3)
      4)
      5)
      6)
      7)
      8)
      9)
      10)
      11)
      12) exit 0
          ;;
      *) echo "Opps! Please Select from on of the choices provided"
         echo "Press any key . . ."
         read -n 1
         ;;
  esac
done
You can use Linux dialog, it is in OpenCSW.
Avatar of arnold
What is it you are after. Ssh with authorized keys is one way to allow you from a central/jumpserver to issue and perform tasks.
Another option is to setup an agent that will run either out of cron ....
That will look for a file in a location, validate the file and then perform the tasks........


Some of those could be proactively monitored with notifications issued centralized syslog, snmptrap server.........
Use a db backend to store data/responses info?
ASKER CERTIFIED SOLUTION
Avatar of Carlos Ijalba
Carlos Ijalba
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I would love to use LINUX anything except this is a system under configuration control.
For that same reason I can't modify the cron file.

I do have a SSH relationship set up between the console and the remote audited system.  These are just tasks I do on a daily basis in conjunction with a whole lot of others.  These are just ones I would like to make easier for myself.

I have people always locking themselves out or we have people that retire or quit and their accounts need to be locked.  Plus I would like to see who is locking their accounts out but don't come and see me and just leave it locked.

I will look over the links and let you know what I come up with.

Thanks