1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
#! /bin/sh
#
# Startup script for Yaws. Use this scripts for FreeBSD versions prior to 9.
YAWS_BIN=%prefix%/bin/yaws
# By default we run with the default id
# YAWS_ID=myserverid
CONF=%etcdir%/yaws/yaws.conf
if [ "x${YAWS_ID}" = x ]; then
idarg=""
else
idarg="--id ${YAWS_ID}"
fi
start() {
echo -n "Starting Yaws: "
$yaws ${idarg} --daemon --heart --conf ${conf} > /dev/null
$yaws ${idarg} --wait-started=10 > /dev/null
RETVAL=$?
if [ $RETVAL = 0 ]; then
echo "OK"
else
echo "FAILED"
fi
return $RETVAL
}
stop() {
echo -n "Stopping Yaws: "
$yaws ${idarg} --stop > /dev/null
$yaws ${idarg} --wait-stopped=10 > /dev/null
RETVAL=$?
if [ $RETVAL = 0 ]; then
echo "OK"
else
echo "FAILED"
fi
return $RETVAL
}
reload() {
echo -n "Reloading Yaws: "
$yaws ${idarg} --hup > /dev/null
RETVAL=$?
if [ $RETVAL = 0 ]; then
echo "OK"
else
echo "FAILED"
fi
return $RETVAL
}
status() {
$yaws ${idarg} --status > /dev/null
RETVAL=$?
if [ $RETVAL = 0 ]; then
echo "Yaws is running"
else
echo "Yaws is stopped"
fi
return $RETVAL
}
|