From: Thibault Godouet Date: Fri, 8 Dec 2000 12:50:24 +0000 (+0000) Subject: check for sysV before rc.local file X-Git-Tag: ver2_9_4~483 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b01edeeb28a71c625379425fe62c0f9d76519ea;p=thirdparty%2Ffcron.git check for sysV before rc.local file --- diff --git a/script/boot-install b/script/boot-install index 87a7f44..b1dc770 100755 --- a/script/boot-install +++ b/script/boot-install @@ -2,7 +2,7 @@ # Install fcron under SysV system. # -# $Id: boot-install,v 1.16 2000-12-04 20:13:14 thib Exp $ +# $Id: boot-install,v 1.17 2000-12-08 12:50:24 thib Exp $ # take 4 arguments : the name of the BSD-like install program # the DESTSBIN directory, the value of DEBUG @@ -64,31 +64,6 @@ if test -f /etc/rc.d/rc.M; then fi fi -INSTALL="nothing" - -if test \( ! "$INSTALLED" -eq 1 \) -a \( -f /etc/rc \) ; then - # FreeBSD - if ! cat /etc/rc.local | grep "$STARTCMD"; then - while test \( ! -z "$INSTALL" \) -a \( "$INSTALL" != "y" \) -a \( "$INSTALL" != "n" \); - do - echo "Would you like to add $STARTCMD in the file /etc/rc.local ?" - read -p "Please answer with 'y' or 'n' (default: 'y'): " INSTALL NOTHING - done - if test \( -z "$INSTALL" \) -o \( "$INSTALL" = "y" \); then - echo $STARTCMD >> /etc/rc.local - INSTALLED=1 - else - INSTALLED=0 - fi - elif cat /etc/rc.local | grep fcron; then - echo "Fcron seems to be in /etc/rc.local, but not with the appropriate options :" - echo "you should probably correct this file in order to run fcron with $STARTCMD." - INSTALLED=1 - else - echo "Fcron is already in /etc/rc.local." - INSTALLED=1 - fi -fi INSTALL="nothing" ROOTDIR="" @@ -132,6 +107,33 @@ if test \( ! "$INSTALLED" -eq 1 \) -a \( "$ROOTDIR" != "" \); then fi +INSTALL="nothing" + +if test \( ! "$INSTALLED" -eq 1 \) -a \( -f /etc/rc \) ; then + # FreeBSD + if ! cat /etc/rc.local | grep "$STARTCMD"; then + while test \( ! -z "$INSTALL" \) -a \( "$INSTALL" != "y" \) -a \( "$INSTALL" != "n" \); + do + echo "Would you like to add $STARTCMD in the file /etc/rc.local ?" + read -p "Please answer with 'y' or 'n' (default: 'y'): " INSTALL NOTHING + done + if test \( -z "$INSTALL" \) -o \( "$INSTALL" = "y" \); then + echo $STARTCMD >> /etc/rc.local + INSTALLED=1 + else + INSTALLED=0 + fi + elif cat /etc/rc.local | grep fcron; then + echo "Fcron seems to be in /etc/rc.local, but not with the appropriate options :" + echo "you should probably correct this file in order to run fcron with $STARTCMD." + INSTALLED=1 + else + echo "Fcron is already in /etc/rc.local." + INSTALLED=1 + fi +fi + + if test "$INSTALLED" -eq 0; then echo echo "Installation process failed to install fcron in your init scripts :"