posaune
[projects.git] / sh / sysd2sysv
1 #!/bin/bash
2 set -e
3
4 if [ $# -ne 2 ]
5 then
6         echo "usage: sysd2sysv <command> <deamon>"
7         exit 1
8 fi
9
10 if [ ! -f /etc/init.d/$2 ]
11 then
12         cp /etc/sysd2sysv/$2 /etc/init.d/
13 fi
14
15 if [ $1 = "enable" ]
16 then
17         update-rc.d $2 defaults 100
18 elif [ $1 = "disable" ]
19 then
20         update-rc.d -f $2 remove
21 else
22         /etc/init.d/$2 $1
23 fi
24
25