epic-ts
authorMichael Wagner <michael@wagnertech.de>
Wed, 18 Jul 2018 09:37:15 +0000 (11:37 +0200)
committerMichael Wagner <michael@wagnertech.de>
Wed, 18 Jul 2018 09:37:15 +0000 (11:37 +0200)
sh/sysd2sysv [new file with mode: 0755]

diff --git a/sh/sysd2sysv b/sh/sysd2sysv
new file mode 100755 (executable)
index 0000000..47e3994
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -e
+
+if [ $# -ne 2 ]
+then
+       echo "usage: sysd2sysv <command> <deamon>"
+       exit 1
+fi
+
+if [ $1 = "enable" ]
+then
+       update-rc.d $2 defaults 100
+elif [ $1 = "disable" ]
+then
+       update-rc.d -f $2 remove
+else
+       /etc/init.d/$2 $1
+fi
+
+