Linux Scripting
Posted by: matta
Posted on: 2008-11-22 14:30:00
I been upgraded to a PS and since it's linux I'm trying to figure out how to run a file on my server. I have a file called ventrilo_srv which I can manually run from putty by typing ./ventrilo_srv -d
Piece of cake, but I was reading something online about scripting and wanted to see what you guys know and but the dir and script is below:
ventrilo_srv (http://battleglory.mattaproductions.com/vent/ventsrv/) where the file is stored
The script I found online:
#!/bin/sh
case "$1" in
start)
echo "Starting Ventrilo Server."
cd /pathtoventrilo/
/ventrilo_srv -d
echo "Ventrilo Server Started"
;;
stop)
echo "Shutting Down Ventrilo Server."
cd /pathofventrilo/
kill `cat ventrilo_srv.pid`
echo "Ventrilo Server Is Now Down"
;;
restart)
echo "Restarting Ventrilo Server..."
cd /pathtoventrilo/
kill `cat ventrilo_srv.pid`
/ventrilo_srv -d
echo "Ventrilo Server Restarted"
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
Im using Notepad and I understand I save the file as filename.sh. Plz someone help if they can.
EDIT: I also did learn this ./ventrilo_srv -d but Im not understanding what the -d does?
MattaEdited by matta on 11/22/08 03:04 PM (server time).