Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- IsStopped=`service mysql status | grep stopped`
- if [ -z $IsStopped ];
- then
- echo "All is good"
- else
- echo "Service MySQL stopped"
- echo "Some usefull information is:"
- echo disk spase used `df -h | grep rootfs | tr -s " " | cut -f5 -d' ' | tr -d % | tr -d " "`%
- echo disk inodes used `df -i | grep rootfs | tr -s " " | cut -f5 -d' ' | tr -d % | tr -d " "`%
- echo All RAM is `free -h | grep Mem | tr -s " " | sed s/'Mem: '// | cut -f1 -d ' '`, used `free -h | grep Mem | tr -s " " | sed s/'Mem: '// | cut -f2 -d ' '`, free `free -h | grep Mem | tr -s " " | sed s/'Mem: '// | cut -f3 -d ' '`
- echo "Try to start MySQL?(y|n)"
- read start
- case $start in
- "y"|"Y") service mysql start;;
- "n"| "N") echo Exiting; exit 0;;
- * ) echo "Invalid input, exiting"; exit 0;;
- esac
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement