1 | #!/bin/sh |
---|
2 | ### BEGIN INIT INFO |
---|
3 | # Provides: sipbmp3 |
---|
4 | # Required-Start: $remote_fs $syslog |
---|
5 | # Required-Stop: $remote_fs $syslog |
---|
6 | # Default-Start: 2 3 4 5 |
---|
7 | # Default-Stop: 0 1 6 |
---|
8 | # Short-Description: Starts lpd for sipbmp3. |
---|
9 | # Description: Starts lpd for sipbmp3 and creates |
---|
10 | # files for use by sipbmp3. |
---|
11 | ### END INIT INFO |
---|
12 | |
---|
13 | case "$1" in |
---|
14 | start) |
---|
15 | mkdir /var/run/sipbmp3 |
---|
16 | touch /var/run/sipbmp3/status |
---|
17 | chmod 0777 /var/run/sipbmp3/status |
---|
18 | |
---|
19 | if [ -x /etc/init.d/lprng ]; then |
---|
20 | script="lprng" |
---|
21 | elif [ -x /etc/init.d/debathena-lprng ]; then |
---|
22 | script="debathena-lprng" |
---|
23 | else |
---|
24 | exit 1 |
---|
25 | fi |
---|
26 | |
---|
27 | if which invoke-rc.d >/dev/null 2>&1; then |
---|
28 | invoke-rc.d "$script" start |
---|
29 | else |
---|
30 | /etc/init.d/"$script" start |
---|
31 | fi |
---|
32 | ;; |
---|
33 | |
---|
34 | stop) |
---|
35 | if [ -x /etc/init.d/lprng ]; then |
---|
36 | script="lprng" |
---|
37 | elif [ -x /etc/init.d/debathena-lprng ]; then |
---|
38 | script="debathena-lprng" |
---|
39 | else |
---|
40 | exit 1 |
---|
41 | fi |
---|
42 | |
---|
43 | rm -r /var/run/sipbmp3 |
---|
44 | if which invoke-rc.d >/dev/null 2>&1; then |
---|
45 | invoke-rc.d "$script" stop |
---|
46 | else |
---|
47 | /etc/init.d/"$script" stop |
---|
48 | fi |
---|
49 | ;; |
---|
50 | |
---|
51 | restart) |
---|
52 | if [ -x /etc/init.d/lprng ]; then |
---|
53 | script="lprng" |
---|
54 | elif [ -x /etc/init.d/debathena-lprng ]; then |
---|
55 | script="debathena-lprng" |
---|
56 | else |
---|
57 | exit 1 |
---|
58 | fi |
---|
59 | |
---|
60 | rm -r /var/run/sipbmp3 |
---|
61 | if which invoke-rc.d >/dev/null 2>&1; then |
---|
62 | invoke-rc.d "$script" stop |
---|
63 | else |
---|
64 | /etc/init.d/"$script" stop |
---|
65 | fi |
---|
66 | |
---|
67 | mkdir /var/run/sipbmp3 |
---|
68 | touch /var/run/sipbmp3/status |
---|
69 | chmod 0777 /var/run/sipbmp3/status |
---|
70 | if which invoke-rc.d >/dev/null 2>&1; then |
---|
71 | invoke-rc.d "$script" start |
---|
72 | else |
---|
73 | /etc/init.d/"$script" start |
---|
74 | fi |
---|
75 | ;; |
---|
76 | |
---|
77 | reload|force-reload|status) |
---|
78 | ;; |
---|
79 | |
---|
80 | *) |
---|
81 | echo "Usage: /etc/init.d/sipbmp3 {start|stop|restart}" >&2 |
---|
82 | exit 1 |
---|
83 | ;; |
---|
84 | esac |
---|