From a7830f826761a675b346ff0e380fb9ec7379cb95 Mon Sep 17 00:00:00 2001 From: thib Date: Thu, 2 Nov 2000 19:08:59 +0000 Subject: [PATCH] script more flexible does not use sysVinit-launcher-debug any more, but modifies sysVinit-launcher if debug mode is set restart fcron when installation is done --- script/boot-install | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/script/boot-install b/script/boot-install index 1df5521..d4eed12 100755 --- a/script/boot-install +++ b/script/boot-install @@ -2,35 +2,42 @@ # Install fcron under SysV system. # -# $Id: boot-install,v 1.10 2000-09-18 08:24:33 thib Exp $ +# $Id: boot-install,v 1.11 2000-11-02 19:08:59 thib Exp $ -# take 2 arguments : the name of the BSD-like install program -# and the DESTSBIN directory +# take 3 arguments : the name of the BSD-like install program +# the DESTSBIN directory, and the value of DEBUG PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin" startdir=$pwd -DEBUG=1 +DEBUG=$3 -if test $# -ne 2; then +if test $# -ne 3; then echo "Too few/many arguments" exit 1 fi -$1 -c -m 755 -o root fcron-launcher $2 +if test $DEBUG -eq 1; then + STARTCMD="fcron -b -d" +else + STARTCMD="fcron -b" +fi if test -f /etc/rc.d/rc.M; then # Slackware - if ! cat /etc/rc.d/rc.local | grep "fcron-launcher"; then - echo "fcron-launcher" >> /etc/rc.d/rc.local + if ! cat /etc/rc.d/rc.local | grep $STARTCMD; then + echo $STARTCMD >> /etc/rc.d/rc.local fi - + killall -TERM fcron + fcron-launcher fi if test -f /etc/rc; then # FreeBSD - if ! cat /etc/rc.local | grep "fcron-launcher"; then - echo "fcron-launcher" >> /etc/rc.local + if ! cat /etc/rc.local | grep $STARTCMD; then + echo $STARTCMD >> /etc/rc.local fi + killall -TERM fcron + fcron-launcher fi ROOTDIR="" if test -d /etc/rc.d/init.d/; then @@ -39,11 +46,15 @@ elif test -d /etc/init.d/; then ROOTDIR="/etc" fi if test $ROOTDIR != ""; then + $1 -c -m 755 -o root sysVinit-launcher $ROOTDIR/init.d/fcron if test $DEBUG -eq 1; then - $1 -c -m 755 -o root sysVinit-launcher-debug $ROOTDIR/init.d/fcron - else - $1 -c -m 755 -o root sysVinit-launcher $ROOTDIR/init.d/fcron + cat $ROOTDIR/init.d/fcron | sed 's: -b: -b -d:' >$ROOTDIR/init.d/fcron2 + mv -f $ROOTDIR/init.d/fcron2 $ROOTDIR/init.d/fcron + chmod +x $ROOTDIR/init.d/fcron fi + cat $ROOTDIR/init.d/fcron | sed "s:@@DESTSBIN@:$2:" >$ROOTDIR/init.d/fcron2 + mv -f $ROOTDIR/init.d/fcron2 $ROOTDIR/init.d/fcron + chmod +x $ROOTDIR/init.d/fcron cd $ROOTDIR/rc2.d/ ; ln -f -s ../init.d/fcron S40fcron cd $ROOTDIR/rc3.d/ ; ln -f -s ../init.d/fcron S40fcron @@ -53,4 +64,8 @@ if test $ROOTDIR != ""; then cd $ROOTDIR/rc0.d/ ; ln -f -s ../init.d/fcron K60fcron cd $ROOTDIR/rc6.d/ ; ln -f -s ../init.d/fcron K60fcron cd $startdir + + killall -TERM fcron + $ROOTDIR/init.d/fcron restart fi + -- 2.40.0