# Install fcron under SysV system.
#
-# $Id: boot-install,v 1.24 2001-02-02 16:54:38 thib Exp $
+# $Id: boot-install,v 1.25 2001-02-11 21:16:23 thib Exp $
# take 5 arguments : the name of the BSD-like install program (with "-o" and the correct username)
# the DESTSBIN directory
if test $3 -eq 1; then
exit
fi
-#DEBUG=$3
-DEBUG=1
+DEBUG=$3
+#DEBUG=1
FCRONTABS=$4
ANSWER=$5
STARTCMD="fcron -b"
fi
+if test `uname -s` = "FreeBSD"; then
+ IS_FREEBSD=1
+else
+ IS_FREEBSD=0
+fi
+
echo
echo "Fcron should be started by your init scripts."
echo "The installation process is going to try to install fcron in them."
RESTARTED=0
INSTALLED=0
+if $IS_FREEBSD -eq 1; then
+ if test -x /usr/local/etc/rc.d/fcron.sh; then
+ echo "Fcron is already in /etc/rc.d/rc.local."
+ INSTALLED=1
+ else
+ if test $ANSWER -eq 2; then
+ while test \( ! -z "$INSTALL" \) -a \( "$INSTALL" != "y" \) -a \( "$INSTALL" != "n" \);
+ do
+ echo "Would you like to add fcron.sh script in the directory /usr/local/etc/rc.d/ ?"
+ read -p "Please answer with 'y' or 'n' (default: 'y'): " INSTALL NOTHING
+ done
+ # automatic answer given by configure script (option --with-answer-all)
+ elif test $ANSWER -eq 1; then
+ INSTALL="y"
+ else
+ INSTALL="n"
+ fi
+ if test \( -z "$INSTALL" \) -o \( "$INSTALL" = "y" \); then
+ cp -f script/fcron.sh /usr/local/etc/rc.d/
+ if test $DEBUG -eq 1; then
+ cat /usr/local/etc/rc.d/fcron.sh | sed 's: -b: -b -d:' > /usr/local/etc/rc.d/fcron.sh2
+ mv -f /usr/local/etc/rc.d/fcron.sh2 /usr/local/etc/rc.d/fcron.sh
+ fi
+ cat /usr/local/etc/rc.d/fcron.sh | sed "s:@@DESTSBIN@:$2:" > /usr/local/etc/rc.d/fcron.sh2
+ mv -f /usr/local/etc/rc.d/fcron.sh2 /usr/local/etc/rc.d/fcron.sh
+ chmod +x /usr/local/etc/rc.d/fcron.sh
+ INSTALLED=1
+ else
+ INSTALLED=0
+ fi
+ fi
+fi
+
+
+INSTALL="nothing"
if test -f /etc/rc.d/rc.M; then
# Slackware
if ! cat /etc/rc.d/rc.local | grep "$STARTCMD"; then
INSTALL="nothing"
if test \( ! "$INSTALLED" -eq 1 \) -a \( -f /etc/rc \) ; then
- # FreeBSD
if ! cat /etc/rc.local | grep "$STARTCMD"; then
if cat /etc/rc.local | grep fcron; then
echo "Fcron seems to be in /etc/rc.local, but not with the appropriate options :"
# Uninstall fcron under SysV system.
#
-# $Id: boot-uninstall,v 1.4 2000-11-18 14:51:29 thib Exp $
+# $Id: boot-uninstall,v 1.5 2001-02-11 21:15:44 thib Exp $
PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
-ROOTDIR=""
-if test -f /etc/rc.d/init.d/fcron; then
+if test `uname -s` = "FreeBSD"; then
+ rm -f /usr/local/etc/rc.d/fcron.sh
+else
+ ROOTDIR=""
+ if test -f /etc/rc.d/init.d/fcron; then
ROOTDIR="/etc/rc.d"
-elif test -f /etc/init.d/fcron; then
+ elif test -f /etc/init.d/fcron; then
ROOTDIR="/etc"
-fi
-if test $ROOTDIR != ""; then
+ fi
+ if test $ROOTDIR != ""; then
rm -f $ROOTDIR/init.d/fcron
rm -f $ROOTDIR/rc2.d/S40fcron
rm -f $ROOTDIR/rc0.d/K60fcron
rm -f $ROOTDIR/rc6.d/K60fcron
-else
+ else
echo
echo "You may delete fcron from your boot script manually"
echo
-fi
+ fi
+fi
\ No newline at end of file
# them if necessary.
#
-# $Id: user-group,v 1.4 2001-01-27 15:32:46 thib Exp $
+# $Id: user-group,v 1.5 2001-02-11 21:16:08 thib Exp $
# take 3 arguments : username
# groupname
INSTALL="nothing"
INSTALLED=0
+if test `uname -s` = "FreeBSD"; then
+ IS_FREEBSD=1
+else
+ IS_FREEBSD=0
+fi
+
echo -n "Checking if $USERNAME is in /etc/passwd ... "
if grep "^$USERNAME:" /etc/passwd > /dev/null; then
echo "yes."
CMD="useradd -c '$USERNAME' $USERNAME"
elif adduser -D 2> /dev/null; then
CMD="adduser -c '$USERNAME' $USERNAME"
+ elif test $IS_FREEBSD -eq 1; then
+ CMD="pw useradd $USERNAME -c $USERNAME"
fi
if test -z "$CMD"; then
echo "Could not determine the command to use to add a user."
INSTALL="nothing"
INSTALLED=0
-CMD="groupadd $GROUPNAME"
+
+if test $IS_FREEBSD -eq 1; then
+ CMD="pw groupadd $GROUPNAME"
+else
+ CMD="groupadd $GROUPNAME"
+fi
echo -n "Checking if $GROUPNAME is in /etc/group ... "
if grep "^$GROUPNAME:" /etc/group > /dev/null; then