#!/bin/bash # # Script to check dhcpd.conf # part stolen from old init.d script # # Last updated: 6th September 2016 # by: Gary Myers CITP MBCS MIET # Paths n stuff # exec=/usr/sbin/dhcpd config=/etc/dhcp/dhcpd.conf RETVAL=0 # Test the config for errors # $exec -q -t -cf $config RETVAL=$? if [ $RETVAL -eq 1 ]; then $exec -t -cf $config else echo "Syntax: OK" >&2 fi # Clean up # unset exec unset config unset RETVAL exit 0