duview build added
[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         sed "s/%PROG%/$2/" /var/sysd2sysv/sysd2sysv.tpl > /etc/init.d/$2
13         chmod 755 /etc/init.d/$2
14 fi
15
16 if [ $1 = "enable" ]
17 then
18         update-rc.d $2 defaults 99
19 elif [ $1 = "disable" ]
20 then
21         update-rc.d -f $2 remove
22 else
23         /etc/init.d/$2 $1
24 fi
25
26