]> git.ipfire.org Git - thirdparty/fcron.git/commitdiff
better support of FreeBSD systems : use killall if pidof does not exist
authorThibault Godouet <yo8192@users.noreply.github.com>
Sun, 7 Jan 2001 20:56:19 +0000 (20:56 +0000)
committerThibault Godouet <yo8192@users.noreply.github.com>
Sun, 7 Jan 2001 20:56:19 +0000 (20:56 +0000)
script/boot-install

index ae1e8e4c991f5d8ffff44957c7efe3041f219eba..e032902ead68b9f07e2bafd1706f2d0a41b3db7f 100755 (executable)
@@ -2,7 +2,7 @@
 # Install fcron under SysV system.
 #
 
-# $Id: boot-install,v 1.20 2001-01-07 12:44:58 thib Exp $
+# $Id: boot-install,v 1.21 2001-01-07 20:56:19 thib Exp $
 
 # take 5 arguments : the name of the BSD-like install program (with "-o" and the correct username)
 #                    the DESTSBIN directory
@@ -172,8 +172,16 @@ fi
 echo 
 echo "You should now restart fcron."
 RESTART="nothing"
-PID=`pidof fcron`
-KILL="kill -TERM $PID"
+COMMENT=""
+if PID=`pidof fcron`; then
+  KILL="kill -TERM $PID"
+  KILLSTR="kill -TERM \`pidof fcron\`"
+else
+  KILL="killall -TERM fcron"
+  KILLSTR=$KILL
+  COMMENT="WARNING : this command may not have the desired effect on non-Linux systems.\n"
+  PID="test -z on PID is not need in this case"
+fi
 if test -z "$PID"; then
     echo "Fcron is not running."
     echo "You may start it after having reinstalled the fcrontabs."
@@ -187,7 +195,8 @@ else
   if test $ANSWER -eq 2; then
     while test \( ! -z "$RESTART" \) -a \( "$RESTART" != "y" \) -a \( "$RESTART" != "n" \);
     do
-      echo "Would you like to do it with a 'kill -TERM \`pidof fcron\`'"
+      echo "Would you like to do it with a '"$KILLSTR"'"
+      echo -n $COMMENT
       echo "followed by a '"$CMD"' ?"
       read -p "Please answer with 'y' or 'n' (default: 'y'): " RESTART NOTHING
     done