home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #
- # Start/stop public and control HTTP services
-
- . /etc/system.cfg
- . /etc/colors
-
- fn1() {
- [ "$1" ] || return
- [ "$LOGHTTP" != n -o "$BOOTMOD" = debug ] || D="-l /dev/null"
- echo -n "Starting $4 HTTP server... $CR"
- thttpd -p $1 -u $2 -d $3 $D
- = $? "Done $CC port $1"
- }
- fn2() { ps | sed -n '/d thttp/P'; }
- stp() {
- [ "`fn2`" ] || return
- echo -n "Stopping HTTP servers... "
- killall thttpd
- =
- }
- str() {
- [ "`fn2`" ] && return
- [ "$ENAWWA" = n ] || fn1 "${WWAPORT:-82}" root /wwa "control"
- [ "$ENAWWW" = n ] || fn1 "${WWWPORT:-80}" nobody /www "public"
- }
-
- case "$1" in
-
- start) str;;
- stop) stp;;
- restart)stp;str;;
- status) if [ "`fn2`" ]
- then echo "Running http servers:"; fn2
- else echo No running http servers
- fi;;
- esac
-