Тhis is the first script I've ever written and I'm looking for some help. I can't find a script like the one I'm trying to write and its becoming a bother because I wish to create more/expand upon such a bash structure.
If some one has the time could they maybe proof read this for me. Could someone tell me what am I doing wrong and why?
#! /bin/bash
# script to turn the screen blue
echo -e '\033[1;32m'
echo "Minecraft Server LTG Bukkit 1.4.7"
echo "Minecraft Server LTG Bukkit 1.4.7"
echo -e '\033[31m' "[Start ] \033[1;32m LTG MineCraft Server"
echo -e '\033[31m' "[Stop ] \033[1;32m LTG MineCraft Server"
echo -e '\033[31m' "[Restart] \033[1;32m LTG MineCraft Server"
echo -e '\033[0m'
cho -e "Hello, \033[47m \033[30m"$USER" \033[0m Enter Command:"
echo "Command:"
read $COM1 start stop restart
if ["$COM1" = "start"]: then
echo "ran minecraft serv"
if [ "$(pgrep -g java -Xmx256M -Xms256M -jar /minecraft/minecraft_server.jar)" ] ; then
echo MineCraft Server Bukkit 1.4.7 L.T.G : Running
else
echo -e "\033[1;32m MineCraft Server Bukkit 1.4.7 L.T.G : \033[31m FAILED \033[0m"
fi
if ["$COM1" "stop"]: then
echo -e "\033[1;32m MineCraft Server Bukkit 1.4.7 L.T.G : Shutting Down \033[0m"
killall java
if (( "$(pgrep -g java -Xmx256M -Xms256M -jar /minecraft/minecraft_server.jar)" )) ; then
killall java
echo -e "\033[1;32m MineCraft Server Bukkit 1.4.7 L.T.G: is SHUTDOWN \033[0m"
fi
if [ "$COM1" "Restart" ] ; then
echo MineCraft Server Bukkit 1.4.7 L.T.G : Rebooting
exit 1
fi
fi
exit 0