Greetings Everyone,
Well I am making the jump to install Wildfire on a brand new Ubuntu Edgy server. My problem is that when I try to use the wildfired script, I get that error:
/wildfired: 50: Syntax error: “(” unexpected
I cannot for the life of me see what’'s wrong with it, line 50 is the execCommand() Function. Everything I can see seems fine, but I have been building this server just about all day so my eyes are a little glossed over. Any thoughts?
NOTE: For reference, I posted the full script here. (Even tho it’‘s the same, I haven’'t modified it except the $WILDFIRE_HOME directive.)
#!/bin/sh
- wildfired Stops and starts the wildfire XMPP service
-
chkconfig: 2345 99 1
-
description: Used to start and stop the wildfire XMPP server
-
Script used to start wildfire as daemon
-
The script has currently been tested on Redhat Fedora Core 3,
-
but should theoretically work on most UNIX like systems
-
before running this script make sure $WILDFIRE_HOME/bin/wildfire is
-
executable by the user you want to run wildfire as
-
(chmod +x $WILDFIRE_HOME/bin/wildfire)
-
This script should be copied into /etc/init.d and linked into
-
your default runlevel directory.
-
You can find your default runlevel directory by typing:
-
grep default /etc/inittab
-
Link to the directory like follows
-
cd /etc/rc.d
-
ln -s …/init.d/wildfired $90wildfired
-
Set this to tell this script where wildfire lives
-
If this is not set the script will look for /opt/wildfire, then /usr/local/wildfire
export WILDFIRE_HOME=/usr/share/wildfire
-
If there is a different user you would like to run this script as,
-
change the following line
#export WILDFIRE_USER=jive
- If a wildfire home variable has not been specified, try to determine it
if ; then
if [ -d “/opt/wildfire” ]; then
WILDFIRE_HOME="/opt/wildfire"
elif [ -d “/usr/local/wildfire” ]; then
WILDFIRE_HOME="/usr/local/wildfire"
else
echo “Could not find Wildfire installation under /opt or /usr/local”
echo “Please specify the Wildfire installation location in environment variable WILDFIRE_HOME”
exit 1
fi
fi
function execCommand() {
OLD_PWD=pwd
cd $WILDFIRE_HOME/bin
CMD="./wildfire $1"
su -c “$CMD” $WILDFIRE_USER &
sleep 1 # allows prompt to return
cd $OLD_PWD
}
start() {
execCommand “start”
}
stop() {
execCommand “stop”
}
case “$1” in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 10 # since stop is backgrounded
start
;;
status)
retval=$(pgrep -u $WILDFIRE_USER -f $WILDFIRE_HOME/bin/wildfire > /dev/null ; echo $?)
if [ “$retval” = “0” ] ; then
echo “wildfire is running”
exit 0
else
echo “wildfire is not running”
exit 0
fi
;;
*)
echo “Usage $0 {start|stop|restart|status}”
exit 1
esac
exit 0