diskimage-builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces.init
Derek Higgins d5225055ef dhcp-all-interfaces: support Centos/RHEL 6
On Centos and RHEL 6 the init system is upsart but but networking is using
sysv compatabiliy and a code path the handle this situation.

We can't use DISTRO_NAME because the centos-minimal element sets it to
centos for CentOS 7 but the centos element sets it to centos for CentOS 6.

Change-Id: Ib8e33ed78b3d6a5737eb7449bccef2d33f72b131
Closes-Bug: #1638527
2016-11-02 11:13:58 +00:00

33 lines
700 B
Bash
Executable File

#!/bin/sh -e
### BEGIN INIT INFO
# Provides: dhcp-all-interfaces
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: S
# Default-Stop: 0 6
# X-Start-Before: networking
# chkconfig: 3 9 50
# Short-Description: Autodetect network interfaces
# Description: Autodetect network interfaces during boot and configure them for DHCP
### END INIT INFO
NAME=dhcp-all-interfaces
INIT_NAME=/etc/init.d/${NAME}
SCRIPT_NAME=/usr/local/sbin/${NAME}.sh
[ -x $SCRIPT_NAME ] || exit 0
case "$1" in
start)
$SCRIPT_NAME
;;
stop)
;;
*)
echo "Usage: $INIT_NAME {start|stop}"
exit 1
;;
esac
exit 0