--- /usr/local/etc/rc.d/quagga.orig 2013-03-15 16:49:13.000000000 +0600 +++ /usr/local/etc/rc.d/quagga 2013-03-15 20:50:59.000000000 +0600 @@ -32,6 +32,20 @@ start_postcmd=start_postcmd stop_postcmd=stop_postcmd +configtest_cmd="check_config" +extra_commands="configtest" + +check_config() { + echo Checking $daemon.conf + $command $daemon_flags -C + result=$? + if [ "$result" -eq "0" ]; then + echo OK + else + echo FAILED + exit + fi +} start_postcmd() { @@ -61,6 +75,9 @@ command=/usr/local/sbin/${daemon} required_files=/usr/local/etc/quagga/${daemon}.conf pidfile=/var/run/quagga/${daemon}.pid + if [ ${quagga_cmd} = "restart" -o ${quagga_cmd} = "start" ]; then + check_config + fi if [ ${quagga_cmd} = "start" -a ! -f ${required_files} ]; then continue fi