]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: extract quiet_check() to avoid duplication
authorAdam Spiers <aspiers@suse.com>
Mon, 23 Feb 2015 15:28:40 +0000 (15:28 +0000)
committerWilly Tarreau <w@1wt.eu>
Mon, 23 Feb 2015 17:13:14 +0000 (18:13 +0100)
Signed-off-by: Adam Spiers <aspiers@suse.com>
examples/haproxy.init

index 67268ebf1736385b10f30a0e7de43c4206fbf13e..bf13b151318f969a69940a0b297e69c6bf3f2f62 100644 (file)
@@ -43,7 +43,7 @@ LOCKFILE=/var/lock/subsys/$BASENAME
 RETVAL=0
 
 start() {
-  $BIN -c -q -f $CFG
+  quiet_check
   if [ $? -ne 0 ]; then
     echo "Errors found in configuration file, check it with '$BASENAME check'."
     return 1
@@ -68,7 +68,7 @@ stop() {
 }
 
 restart() {
-  $BIN -c -q -f $CFG
+  quiet_check
   if [ $? -ne 0 ]; then
     echo "Errors found in configuration file, check it with '$BASENAME check'."
     return 1
@@ -78,7 +78,7 @@ restart() {
 }
 
 reload() {
-  $BIN -c -q -f $CFG
+  quiet_check
   if [ $? -ne 0 ]; then
     echo "Errors found in configuration file, check it with '$BASENAME check'."
     return 1
@@ -90,6 +90,10 @@ check() {
   $BIN -c -q -V -f $CFG
 }
 
+quiet_check()
+  $BIN -c -q -f $CFG
+}
+
 rhstatus() {
   status $BASENAME
 }