From: Sebastian Hagedorn Date: Fri, 29 May 2015 12:52:37 +0000 (+0200) Subject: Check if radius is running X-Git-Tag: release_3_0_9~304 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf9e8d267f54f3711aff14853003815c94b7b4e1;p=thirdparty%2Ffreeradius-server.git Check if radius is running post-receive checks if radius is running. If not, it will accept changes based on the config check, without trying to restart radiusd. --- diff --git a/scripts/git/post-receive b/scripts/git/post-receive index ed5734a49f1..3f44994f56a 100755 --- a/scripts/git/post-receive +++ b/scripts/git/post-receive @@ -9,12 +9,16 @@ # # Copyright 2012 Arran Cudbard-Bell +PATH=/bin:/usr/bin:/usr/sbin:/sbin # Tag to update when we successfully manage to start the server with a new configuration : ${STABLE_TAG='stable'} # Descriptive name of daemon : ${DAEMON_DESC='FreeRADIUS'} +# Init script for radiusd +: ${DAEMON_STATUS='/etc/init.d/radiusd status'} + # Command used to restart the RADIUS daemon : ${DAEMON_REST='radmin -e hup'} @@ -65,6 +69,13 @@ conf_check () { return $ret } +daemon_status () { + echo -n "Checking if radiusd is running ... " + $DAEMON_STATUS; ret=$? + + return $ret +} + daemon_restart () { echo -n "Restarting server... " @@ -113,7 +124,7 @@ if ! conf_check; then conf_rollback exit 64 else - if ! daemon_restart; then + if daemon_status && ! daemon_restart ; then if ! conf_rollback; then echo "WARNING: Manually verify $DAEMON_DESC status immediately!" exit 64