#!/bin/sh

. /etc/control.d/functions
. /bin/shell-config

CONFIG=/etc/sysconfig/dhcpd

if [[ -z $(shell_config_get "$CONFIG" "CHROOT") ]]; then
    shell_config_set "$CONFIG" "CHROOT" ""
fi

new_summary 'Chrootedness of the ISC DHCPD server'

new_subst disabled \
	"^CHROOT=.*-j.*$" \
	"s/^CHROOT=.*/CHROOT=\"-j \/ -lf \/var\/lib\/dhcp\/dhcpd\/state\/dhcpd.leases\"/g"
new_help disabled 'Disable chrootedness of the ISC DHCPD server'

new_subst enabled \
	"^CHROOT=$|^CHROOT=\"\"$|^CHROOT=''$" \
	"s/^CHROOT=.*/CHROOT=/g"
new_help enabled 'Enable chrootedness of the ISC DHCPD server'

control_subst "$CONFIG" "$*"
