ctdb-scripts: Clean up function detect_init_style()
authorMartin Schwenke <martin@meltin.net>
Mon, 19 Feb 2018 04:29:43 +0000 (15:29 +1100)
committerAmitay Isaacs <amitay@samba.org>
Wed, 28 Mar 2018 00:57:19 +0000 (02:57 +0200)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/functions

index f85afb2b6b63d6c831d504aad314c7e8beee1360..7014d788c8045c4bbc464958ab1143c96b30faa6 100755 (executable)
@@ -171,16 +171,18 @@ ctdb_check_args ()
 # determine on what type of system (init style) we are running
 detect_init_style()
 {
-    # only do detection if not already set:
-    [ -z "$CTDB_INIT_STYLE" ] || return
+       # only do detection if not already set:
+       if [ -n "$CTDB_INIT_STYLE" ] ; then
+               return
+       fi
 
-    if [ -x /sbin/startproc ]; then
-        CTDB_INIT_STYLE="suse"
-    elif [ -x /sbin/start-stop-daemon ]; then
-        CTDB_INIT_STYLE="debian"
-    else
-        CTDB_INIT_STYLE="redhat"
-    fi
+       if [ -x /sbin/startproc ]; then
+               CTDB_INIT_STYLE="suse"
+       elif [ -x /sbin/start-stop-daemon ]; then
+               CTDB_INIT_STYLE="debian"
+       else
+               CTDB_INIT_STYLE="redhat"
+       fi
 }
 
 ######################################################