Hello,
Currently I am working on a small project and I need help with MyScript. I wrote a simple script (lets call it MyScript) to update certain applications on my Linux box. The script runs just fine, but I need to take it to the next level and make it more interactive. I need the script to carry out the following:
Present the user with a dialog "screen/window" to select either one or multiple applications to install/upgrade. Hence, the script will install/update the selected applications, only.
Let's say I wan to upgrade Exim, Php, and httpd -- MyScript menu allows me to select either one, two, or all of them.
Let's say I am trying to upgrade exim. Before MyScript start downloading the tar ball package, MyScript will compare the current version installed on the server:
a) if the same, MyScript will say, "Your current mail server is up-to-date.";
b) If old, MyScript will download and install the new version:
So, the menu can use a loop, something like the code written by jbsnake (Intermediate Bash Tutorial):
http://bashscripts.org/viewtopic.php?t=40
Code:
#!/bin/bash
### start main ###
echo "Please choose one of the following:"
echo "1) Install/Upgrade Exim"
echo "2) Install/Upgrade Php v5.x"
echo "3) Install/Upgrade MySQL v6.x"
echo "4) More Applications"
echo "0) Exit"
read choice
while [[ $choice != 0 ]]
do
case $choice in
1) clear;
wget -o http://ftp.exim.llorien.org/exim/exim4/exim-4.69.tar.gz
tar xzf exim-4.69.tar.gz
cd exim-4.69
./conifgure
./make
./make install
;;
2) clear;
UPGRADE PHP;
;;
3) clear;
UPGRADE MySQL;
;;
4) clear;
MORE APPS;
;;
0) clear;
echo "Returning to command line . . .";
exit;
;;
*) clear;
echo "Not a valid selection!";
;;
esac
echo "Please choose one of the following:"
echo "1) Install/Upgrade Exim"
echo "2) Install/Upgrade Php v5.x"
echo "3) Install/Upgrade MySQL v6.x"
echo "4) More Applications"
echo "0) Exit"
read choice
done
This script will run on CentOS, Fedora Core, and RedHat.
Any help is greatly appreciate. I am even willing to pay for your time. Thank you
Kal