 e4868d9ad6
			
		
	
	e4868d9ad6
	
	
	
		
			
			DIB_INIT_SYSTEM is exported by the dib-init-system element and contains the output of the dib-init-system script so there is no need to re-initialize it during various phases. Change-Id: I09d6d10742689efe3d8eb9d64b539d6599b46227
		
			
				
	
	
		
			37 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/bash
 | |
| 
 | |
| if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
 | |
|     set -x
 | |
| fi
 | |
| set -eu
 | |
| set -o pipefail
 | |
| 
 | |
| SCRIPTDIR=$(dirname $0)
 | |
| 
 | |
| # 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
 | |
| 
 | |
| if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then
 | |
|     if [ -e "/etc/redhat-release" ] ; then
 | |
|         # the init system is upstart but networking is using sysv compatabiliy (i.e. Centos/RHEL 6)
 | |
|         install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.init /etc/init.d/dhcp-all-interfaces
 | |
|         chkconfig dhcp-all-interfaces on
 | |
|     else
 | |
|         install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.conf /etc/init/dhcp-all-interfaces.conf
 | |
|     fi
 | |
| 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
 | |
| 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
 | |
| fi
 |