mkdir -p $1/usr/bin/
cp sh/sysd2sysv $1/usr/bin/
+mkdir -p $1/var/sysd2sysv
+cp etc/sysd2sysv.tpl $1/var/sysd2sysv/
+
# copy man page
mkdir -p $1/usr/share/man/man8
gzip -c doc/sysd2sysv.8 >$1/usr/share/man/man8/sysd2sysv.8.gz
--- /dev/null
+#!/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
+ then
+ rm $file
+ fi
+ # for downward compatibility
+ if [ -f mlistd ]
+ then
+ rm mlistd
+ fi
+done
+
.SH DESCRIPTION
.PP
sysd2sysv checks, if the service is present in /etc/init.d. If not
-it is expected to be in /etc/sysd2sysv and copied to /etc/init.d.
+it builds one from /etc/init.d/sysd2sysv.tpl.
.PP
Do not install in a Systemd environment!
.SH AUTHOR
if [ ! -f /etc/init.d/$2 ]
then
- cp /etc/sysd2sysv/$2 /etc/init.d/
+ sed "s/%PROG%/$2/" /var/sysd2sysv/sysd2sysv.tpl > /etc/init.d/$2
+ chmod 755 /etc/init.d/$2
fi
if [ $1 = "enable" ]