2013-11-07 04:25:34 +00:00
|
|
|
#!/bin/bash
|
2014-09-04 04:56:29 +00:00
|
|
|
|
|
|
|
if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
set -eu
|
2014-03-29 03:28:22 +00:00
|
|
|
set -o pipefail
|
2013-03-05 17:34:19 +00:00
|
|
|
|
|
|
|
SCRIPTDIR=$(dirname $0)
|
|
|
|
|
2016-03-31 00:48:19 +00:00
|
|
|
# this script is not needed on Gentoo.
|
|
|
|
if [ "$DISTRO_NAME" != "gentoo" ]; then
|
|
|
|
install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.sh /usr/local/sbin/dhcp-all-interfaces.sh
|
|
|
|
fi
|
2014-01-09 20:32:52 +00:00
|
|
|
|
|
|
|
DIB_INIT_SYSTEM=$(dib-init-system)
|
|
|
|
if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then
|
2013-10-14 22:54:37 +00:00
|
|
|
install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.conf /etc/init/dhcp-all-interfaces.conf
|
2014-01-09 20:32:52 +00:00
|
|
|
elif [ "$DIB_INIT_SYSTEM" == "systemd" ]; then
|
2014-03-19 18:33:14 +00:00
|
|
|
install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-interface@.service /usr/lib/systemd/system/dhcp-interface@.service
|
2014-03-21 19:12:37 +00:00
|
|
|
install -D -g root -o root -m 0644 ${SCRIPTDIR}/dhcp-all-interfaces-udev.rules /etc/udev/rules.d/99-dhcp-all-interfaces.rules
|
2014-04-09 11:58:36 +00:00
|
|
|
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
|
2016-03-31 00:48:19 +00:00
|
|
|
elif [ "$DISTRO_NAME" == "gentoo" ]; then
|
|
|
|
# let ipv6 use normal slaac
|
|
|
|
sed -i 's/slaac/#slaac/g' /etc/dhcpcd.conf
|
|
|
|
# don't let dhcpcd set domain name or hostname
|
|
|
|
sed -i 's/domain_name\,\ domain_search\,\ host_name/domain_search/g' /etc/dhcpcd.conf
|
|
|
|
rc-update add dhcpcd default
|
2013-10-14 22:54:37 +00:00
|
|
|
fi
|