File: micro-httpd.prerm

package info (click to toggle)
micro-httpd 20051212-15
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 160 kB
  • ctags: 121
  • sloc: ansic: 695; sh: 165; makefile: 98
file content (92 lines) | stat: -rwxr-xr-x 1,149 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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/sh

set -e

PATH="/sbin:/bin:/usr/sbin:/usr/bin"
PACKAGE=$(basename $0 | sed 's/\..*//')
pkgdir=/usr/share/$PACKAGE
conf=/etc/inetd.conf
port="www"
entry=

Debhelper ()
{
    :
    #DEBHELPER#
}

Which ()
{
    which "$1" > /dev/null 2>&1
}

Die ()
{
    echo "$0: $*" >&2
    exit 1
}

IsInetd ()
{
    [ -x /usr/sbin/update-inetd ]
}

IsInetdConf ()
{
    [ -f $conf ]
}

InetdName ()
{
    local name=

    if [ -f /etc/init.d/inetutils-inetd ]; then
	name=inetutils-inetd
    elif [ -f /etc/init.d/openbsd-inetd ]; then
        name="openbsd-inetd"
    elif [ -f /etc/init.d/rlinetd ]; then
        name="rlinetd"
    fi

    [ ! "$name" ] || echo $name
}

CallInetd ()
{
    local name=$1
    local cmd=$2

    [ "$cmd" ] || return 0

    if Which invoke-rc.d ; then
	invoke-rc.d $name $cmd
    else
	/etc/init.d/$name $cmd
    fi
}

MainInetd ()
{
    if [ "$1" = "remove" ]; then

	echo "$0: removing $conf entry" >&2
	update-inetd --group STANDARD --remove "$port.*$PACKAGE"

	local name=$(InetdName)

	CallInetd $name reload
    fi
}

Main ()
{
    if IsInetd ; then
	MainInetd "$@"
    fi

    Debhelper
}

Main "$@"

# End of file