On Sep 9, 2009, at 12:00 AM, Arvind wrote:
> when i run the startup script for arch linux provided inside the
> scripts folder. i keep getting this error.
>
> web2py.archlinux.sh: line 13: [: -ne: unary operator expected
>
> I have copied this script into the main web2py directory and from
> there i am running it.
>
> i am not quite sure how this is supposed to run.
>
> can anybody please help ?
Can somebody explain what this script is trying to do? I speak bash
well enough, but if this makes sense, I don't see it.
The complaint is because $pid is empty.
#!/bin/bash
# the script should be run
# from WEB2PY root directory
prog=`basename $0`
cd `pwd`
chmod +x $prog
function web2py_start {
nohup ./$prog -a "<recycle>" 2>/dev/null &
pid=`pgrep $prog | tail -1`
if [ $pid -ne $$ ]
then
echo "WEB2PY has been started."
fi
}
function web2py_stop {
kill -15 `pgrep $prog | grep -v $$` 2>/dev/null
pid=`pgrep $prog | head -1`
if [ $pid -ne $$ ]
then
echo "WEB2PY has been stopped."
fi
}
case "$1" in
start)
web2py_start
;;
stop)
web2py_stop
;;
restart)
web2py_stop
web2py_start
;;
*)
echo "Usage: $prog [start|stop|restart]"
;;
esac
exit 0
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---