#!/bin/sh

# Warning
# -------
#
# Please edit the files in
#   /usr/local/www/webkit/Configs/
# to suit your needs. Using them as they are may cause problems.

# This file is adapted from databases/postgresql7/files/pgsql.sh.tmpl
#
# $FreeBSD: www/py-webware/files/webkit.sh.tmpl 300897 2012-07-14 14:29:18Z beat $

WEBKIT_HOME_DIR=/usr/local/www/webkit

case $1 in
start)
    [ -x ${WEBKIT_HOME_DIR}/AppServer ] && {
        su -l webware -c "exec ${WEBKIT_HOME_DIR}/AppServer" \
            >/dev/null 2>&1 &
        echo -n ' webkit'
    }
    ;;

stop)
    [ -f ${WEBKIT_HOME_DIR}/appserverpid.txt ] && {
        su -l webware -c \
            "/bin/kill `cat ${WEBKIT_HOME_DIR}/appserverpid.txt`" \
                >/dev/null 2>&1
        echo -n ' webkit'
    }
    ;;

*)
    echo "usage: `basename $0` {start|stop}" >&2
    exit 1
    ;;
esac
