diff -ruN data.orig/etc/init.d/dhcpd data/etc/init.d/dhcpd --- data.orig/etc/init.d/dhcpd 2006-08-31 23:49:35 +0000 +++ data/etc/init.d/dhcpd 2007-03-09 13:53:49 +0000 @@ -6,15 +6,15 @@ DHCPD_CONF="/etc/dhcp/dhcpd.conf" # Work out our cffile if it's on our DHCPD_OPTS -if [[ " ${DHCPD_OPTS} " == *" -cf "* ]]; then - DHCPD_CONF=" ${DHCPD_OPTS} " - DHCPD_CONF="${DHCPD_CONF##* -cf }" - DHCPD_CONF="${DHCPD_CONF%% *}" - - # Now we have the cffile, we can remove it from our options - DHCPD_OPTS="${DHCPD_OPTS//-cf/}" - DHCPD_OPTS="${DHCPD_OPTS//${DHCPD_CONF}/}" -fi +case " ${DHCPD_OPTS} " in + *" -cf "*) + DHCPD_CONF=" ${DHCPD_OPTS} " + DHCPD_CONF="${DHCPD_CONF##* -cf }" + DHCPD_CONF="${DHCPD_CONF%% *}" + # Now we have the cffile, we can remove it from our options + DHCPD_OPTS="`echo ${DHCPD_OPTS} | sed 's/-cf//; s/""${DHCPD_CONF}""//'` + ;; +esac depend() { need net @@ -27,14 +27,14 @@ } start() { - if [[ ! -f "${DHCPD_CHROOT}/${DHCPD_CONF}" ]] ; then + if [ ! -f "${DHCPD_CHROOT}/${DHCPD_CONF}" ] ; then eerror "${DHCPD_CHROOT}/${DHCPD_CONF} does not exist" return 1 fi local leasefile="$(get_var lease-file-name)" leasefile="${DHCPD_CHROOT}/${leasefile:-/var/lib/dhcp/dhcpd.leases}" - if [[ ! -f ${leasefile} ]] ; then + if [ ! -f ${leasefile} ] ; then ebegin "Creating ${leasefile}" touch "${leasefile}" chown dhcp:dhcp "${leasefile}" @@ -42,7 +42,7 @@ fi # Setup LD_PRELOAD so name resolution works in our chroot. - if [[ -n ${DHCPD_CHROOT} ]] ; then + if [ -n "${DHCPD_CHROOT}" ] ; then LD_PRELOAD="${LD_PRELOAD} /usr/lib/libresolv.so" export LD_PRELOAD="${LD_PRELOAD} /usr/lib/libnss_dns.so" fi