Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Please note that your main config file (OpenCHAT.conf)
- #must be located in /etc to make this script work from any folder
- #(and of course this script itself must be located in your PATH)
- #This is the folder where your OpenCHAT.jar and other conf files are located
- installfolder=/path/to/OpenCHAT
- if [ $# -eq 0 -o $# -gt 1 ]; then
- echo "Usage : openchat [stop/start]"
- else
- if [ $1 = "start" ]; then
- if [ -f $installfolder/OpenCHAT.pid ]; then
- echo "OpenCHAT is already started"
- else
- java -jar $installfolder/OpenCHAT.jar >> $installfolder/OpenCHAT.logs &
- echo $! > $installfolder/OpenCHAT.pid
- fi
- elif [ $1 = "stop" ]; then
- if [ -f $installfolder/OpenCHAT.pid ]; then
- pid=`cat $installfolder/OpenCHAT.pid`
- kill -9 $pid
- rm $installfolder/OpenCHAT.pid
- else
- echo "OpenCHAT is not started yet"
- fi
- else
- echo "Usage : openchat [stop/start]"
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement