1 #!/bin/bash 2 # 3 #Bootup options menu for emergency procedures 4 #This will allow untrained staff to reboot the machine 5 #And will allow for stopping and starting of apache, mysql, and 6 #Full database checks. This will also allow for assorted other 7 #commands to be ran, updated through alpine update 8 #It will have the ability to update itself 9 let "loop=0" 10 while test $loop == 0 11 do 12 clear 13 echo "Please select a procedure from the list and press enter" 14 echo "----------------------------------------------------" 15 echo "a. Shutdown" 16 echo "b. Stop and Start Apache, needed after boot" 17 echo "c. Start Apache" 18 echo "d. Start Mysql" 19 echo "e. Restart Mysql" 20 echo "f. Check database health" 21 echo "g. Logout" 22 echo "choice?" 23 read choice 24 25 case $choice in g) 26 let "loop=1" 27 esac 28 case $choice in a) 29 echo "System Hard Shutting Down NOW!!!" 30 sudo shutdown -h now 31 sleep 10 32 shutdown -h now 33 esac 34 case $choice in b) 35 sudo apachectl stop && sudo apachectl start 36 sleep 10 37 esac 38 case $choice in c) 39 sudo apachectl start 40 sleep 10 41 esac 42 case $choice in d) 43 /usr/local/etc/rc.d/mysql-server.sh start 44 sleep 10 45 esac 46 case $choice in e) 47 /usr/local/etc/rc.d/mysql-server.sh restart 48 sleep 10 49 esac 50 case $choice in f) 51 mysqlcheck --all-databases --auto-repair 52 sleep 10 53 esac 54 55 done ~