#!/bin/sh

export PS4="$0: " ; set -x

case "$1" in

  start)
    need mounts || exit 1
    need usr || exit 1
    @CONFIG_HTTPD_PATH@/httpd @MLCONFIG_PORT@ @MAINDIR@ &
    echo $! > /tmp/config_httpd.pid
    ;;

  resume)
    need mounts || exit 1
    need usr || exit 1
    ;;

  stop)
    # use busybox kill instead of shell builtin
    /bin/kill -z `cat /tmp/config_httpd.pid`
    ;;

esac

exit 0
