File: Yaws.StartupItem

package info (click to toggle)
yaws 1.65-4etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,164 kB
  • ctags: 3,907
  • sloc: erlang: 20,138; sh: 3,675; makefile: 556; ansic: 404; lisp: 79
file content (39 lines) | stat: -rw-r--r-- 617 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

##
# Yaws HTTP Server
##

. /etc/rc.common

yaws=%prefix%/bin/yaws
lockdir=/var/spool/lock
yawsid=myserverid

StartService ()
{
    if [ "${YAWS:=-NO-}" = "-YES-" ]; then
	ConsoleMessage "Starting yaws http daemon"
	HOME=/tmp $yaws --id ${yawsid} --daemon --heart
	RETVAL=$?
	[ $RETVAL = 0 ]
    fi
}

StopService ()
{
    ConsoleMessage "Stopping yaws http daemon"
    HOME=/tmp $yaws --id ${yawsid} --stop
}

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

RunService "$1"