]> wagnertech.de Git - projects.git/blobdiff - debian/sysd2sysv.postinst
cpp-d1064d
[projects.git] / debian / sysd2sysv.postinst
index 442c70fb62b6170e2cd4d6154f4302db1e66c6aa..e47abd8ffaf98595f76e14bebf55fd91de1701a0 100755 (executable)
@@ -5,14 +5,16 @@ set -e
 pushd /etc/init.d >/dev/null
 for file in $(ls)
 do
-       if grep "# sysd2sysv-template #" $file
+       if grep "# sysd2sysv-template #" $file >/dev/null
        then
-               rm $file
-       fi
-       # for downward compatibility
-       if [ -f mlistd ]
-       then
-               rm mlistd
+               echo "renew $file from template"
+               sed "s/%PROG%/$file/" /var/sysd2sysv/sysd2sysv.tpl > $file
        fi
 done
 
+# for downward compatibility
+if [ -f mlistd ]
+then
+       sed "s/%PROG%/mlistd/" /var/sysd2sysv/sysd2sysv.tpl > mlistd
+fi
+