I'm going mad not being able to get this to work. im assuming its only a simple mistake but its driving me bonkers trying to find it.
Please if you can help me it would save me pulling my hair out!!
Thanks
#!/bin/bash -xv
#
#Config
name="TEST Server"
+ name='TEST Server'
path="/home/call4it/murmur"
+ path=/home/call4it/murmur
user="call4it"
+ user=call4it
server="murmur.x86"
+ server=murmur.x86
pid="$path/mumble"
+ pid=/home/call4it/murmur/mumble
# Startup Mumble Server
service_start() {
# Check if the pid files currently exist
if [ -f $pid ]; t$
# Pid files allready exist check if the process is still running.
if [ "$(ps -fp `cat $pid` | wc -l)" -gt 1 ]; then
# Process is still running.
echo -e "Cannot start $name. Server is already running."
#exit 1
else
# Process exited with out cleaning up pid files.
if [ "$(ps -fp `cat $pid` | wc -l)" -gt 1 ]; then
# Screen is still running.
# Get the process ID from the pid file we created earlier
for id in `cat $pid`
do kill -9 $id
echo "Killing process ID $id"
echo "Removing $name pid file"
rm -rf $pid
break
done
fi
# Remove server pid file
echo "Removing $name pid file"
rm -rf $pid
# Server is not running start the server.
if [ -x $server ] ; then
echo "Starting $name - $user"
cd $path
$server
# Prevent race condition on SMP kernels
sleep 1
echo "$name started."
# Was having problems with directory permisions due to FTP access m$
chmod 666 $pid 1> /dev/null 2> /dev/null
# Make any pid files created by different users owned by the set us$
chown $user $pid 1> /dev/null 2> /dev/null
sleep 2
fi
}
./mumstart: line 52: syntax error near unexpected token `}'
./mumstart: line 52: `}'