e5f537ff2a
This patch adds support for sysv init to the dhcp-all-interfaces element. Specifically, it adds a sysv init script and the relevant install/config steps. Tested with Debian jessie/testing. Change-Id: I4ae1d5365bafda188cb65ea1fb72d8ffe2408910
18 lines
850 B
Bash
Executable File
18 lines
850 B
Bash
Executable File
#!/bin/bash
|
|
set -x
|
|
|
|
SCRIPTDIR=$(dirname $0)
|
|
|
|
install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.sh /usr/local/sbin/dhcp-all-interfaces.sh
|
|
|
|
DIB_INIT_SYSTEM=$(dib-init-system)
|
|
if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then
|
|
install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.conf /etc/init/dhcp-all-interfaces.conf
|
|
elif [ "$DIB_INIT_SYSTEM" == "systemd" ]; then
|
|
install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-interface@.service /usr/lib/systemd/system/dhcp-interface@.service
|
|
install -D -g root -o root -m 0644 ${SCRIPTDIR}/dhcp-all-interfaces-udev.rules /etc/udev/rules.d/99-dhcp-all-interfaces.rules
|
|
elif [ "$DIB_INIT_SYSTEM" == "sysv" ]; then
|
|
install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.init /etc/init.d/dhcp-all-interfaces
|
|
update-rc.d dhcp-all-interfaces defaults
|
|
fi
|