I'll be more verbose. Here's what the script appears (to me) to be
doing.
> #!/bin/bash
> # the script should be run
> # from WEB2PY root directory
>
> prog=`basename $0`
This sets $prog to web2py.archlinux.sh
>
> cd `pwd`
Change directories to the current directory. Huh?
> chmod +x $prog
Make web2py.archlinux.sh executable. This is a little strange, because
if we're here, it's already being executed.
>
> function web2py_start {
> nohup ./$prog -a "<recycle>" 2>/dev/null &
Remember that $prog is web2py.archlinux.sh, not web2py.py.
> pid=`pgrep $prog | tail -1`
pgrep compares to the first 15 chars of the process name,
"web2py.archlinu", so it never finds anything.
> if [ $pid -ne $$ ]
$pid is empty, so this is bad syntax.
> 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
-~----------~----~----~----~------~----~------~--~---