#!/bin/bash set -e # delete init files created from template pushd /etc/init.d >/dev/null for file in $(ls) do if grep "# sysd2sysv-template #" $file >/dev/null then 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