File: Yaws.StartupItem

package info (click to toggle)
yaws 2.1.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,012 kB
  • sloc: erlang: 42,153; sh: 2,501; javascript: 1,459; makefile: 968; ansic: 890; lisp: 79; python: 34; xml: 12; php: 1
file content (42 lines) | stat: -rw-r--r-- 858 bytes parent folder | download | duplicates (6)
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
#!/bin/sh

##
# Yaws HTTP Server
##

. /etc/rc.common

yaws=%bindir%/yaws
lockdir=/var/spool/lock
#yawsid_opts='--id myserverid'
conf="--conf %etcdir%/yaws/yaws.conf"

StartService ()
{
    if [ "${YAWS:=-NO-}" = "-YES-" ]; then
        ConsoleMessage "Starting yaws http daemon"
        HOME=/tmp $yaws ${yawsid_opts} --daemon --heart ${conf}
        HOME=/tmp $yaws ${yawsid_opts} --wait-started=10 >/dev/null
        RETVAL=$?
        [ $RETVAL = 0 ]
    fi
}

StopService ()
{
    ConsoleMessage "Stopping yaws http daemon"
    HOME=/tmp $yaws  ${yawsid_opts} --stop
        HOME=/tmp $yaws ${yawsid_opts} --wait-stopped=10 >/dev/null
}

RestartService ()
{
    if [ "${YAWS:=-NO-}" = "-YES-" ]; then
        ConsoleMessage "Restarting yaws http daemon"
        HOME=/tmp $yaws ${yawsid_opts} --hup
    else
        StopService
    fi
}

RunService "$1"