Created
October 14, 2016 15:53
-
-
Save mpalpha/b7aa80ffb686c3f886fa2c862e4a7c24 to your computer and use it in GitHub Desktop.
menu dialog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| show_menu(){ | |
| NORMAL=`echo "\033[m"` | |
| MENU=`echo "\033[36m"` #Blue | |
| NUMBER=`echo "\033[33m"` #yellow | |
| FGRED=`echo "\033[41m"` | |
| RED_TEXT=`echo "\033[31m"` | |
| ENTER_LINE=`echo "\033[33m"` | |
| echo -e "${MENU}*********************************************${NORMAL}" | |
| echo -e "${MENU}**${NUMBER} 1)${MENU} Mount dropbox ${NORMAL}" | |
| echo -e "${MENU}**${NUMBER} 2)${MENU} Mount USB 500 Gig Drive ${NORMAL}" | |
| echo -e "${MENU}**${NUMBER} 3)${MENU} Restart Apache ${NORMAL}" | |
| echo -e "${MENU}**${NUMBER} 4)${MENU} ssh Frost TomCat Server ${NORMAL}" | |
| echo -e "${MENU}**${NUMBER} 5)${MENU} ${NORMAL}" | |
| echo -e "${MENU}*********************************************${NORMAL}" | |
| echo -e "${ENTER_LINE}Please enter a menu option and enter or ${RED_TEXT}enter to exit. ${NORMAL}" | |
| read opt | |
| } | |
| function option_picked() { | |
| COLOR='\033[01;31m' # bold red | |
| RESET='\033[00;00m' # normal white | |
| MESSAGE=${@:-"${RESET}Error: No message passed"} | |
| echo -e "${COLOR}${MESSAGE}${RESET}" | |
| } | |
| clear | |
| show_menu | |
| while [ opt != '' ] | |
| do | |
| if [[ $opt = "" ]]; then | |
| exit; | |
| else | |
| case $opt in | |
| 1) clear; | |
| option_picked "Option 1 Picked"; | |
| sudo mount /dev/sdh1 /mnt/DropBox/; #The 3 terabyte | |
| menu; | |
| ;; | |
| 2) clear; | |
| option_picked "Option 2 Picked"; | |
| sudo mount /dev/sdi1 /mnt/usbDrive; #The 500 gig drive | |
| menu; | |
| ;; | |
| 3) clear; | |
| option_picked "Option 3 Picked"; | |
| sudo service apache2 restart; | |
| show_menu; | |
| ;; | |
| 4) clear; | |
| option_picked "Option 4 Picked"; | |
| ssh lmesser@ -p 2010; | |
| show_menu; | |
| ;; | |
| x)exit; | |
| ;; | |
| \n)exit; | |
| ;; | |
| *)clear; | |
| option_picked "Pick an option from the menu"; | |
| show_menu; | |
| ;; | |
| esac | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment