]> granicus.if.org Git - fcron/commitdiff
added support for nsswitch.conf in installation scripts
authorthib <thib>
Mon, 9 Jul 2001 13:07:58 +0000 (13:07 +0000)
committerthib <thib>
Mon, 9 Jul 2001 13:07:58 +0000 (13:07 +0000)
Makefile.in
script/user-group

index e13cba1d9eefcf37de01110779ebcd0d6af68939..29d9b946e3c9db06d5f840dd34c087c7fb5ce4b9 100644 (file)
@@ -4,7 +4,7 @@
 
 # @configure_input@
 
-# $Id: Makefile.in,v 1.74 2001-07-07 17:44:45 thib Exp $
+# $Id: Makefile.in,v 1.75 2001-07-09 13:07:58 thib Exp $
 
 # The following should not be edited manually (use configure options)
 # If you must do it, BEWARE : some of the following is also defined
@@ -91,7 +91,7 @@ install: all
 # needed by boot-install script :
        echo `fcron -V 2>&1 | grep "^fcron "` > $(SRCDIR)/script/PREVIOUS_VERSION
 
-       $(SRCDIR)/script/user-group $(USERNAME) $(GROUPNAME) $(ANSWERALL)
+       $(SRCDIR)/script/user-group $(USERNAME) $(GROUPNAME) $(ANSWERALL) $(SRCDIR)
 
 # check if the directories we use exist, and if not, create them
        if test ! -d $(DESTSBIN); then $(INSTALL) -g $(ROOTGROUP) -o $(ROOTNAME) -m 755 -d $(DESTSBIN) ; fi
@@ -111,9 +111,9 @@ install: all
        test -f $(ETC)/fcron.allow || test -f $(ETC)/fcron.deny || $(INSTALL) -m 640 -o $(ROOTNAME) -g $(GROUPNAME) $(SRCDIR)/files/fcron.allow $(SRCDIR)/files/fcron.deny $(ETC)
        test -f $(ETC)/fcron.conf || $(INSTALL) -m 640 -o $(ROOTNAME) -g $(GROUPNAME) $(SRCDIR)/files/fcron.conf $(ETC)
        $(INSTALL) -m 644 -o $(ROOTNAME) $(SRCDIR)/doc/fcron.8 $(DESTMAN)/man8
-       $(INSTALL) -m 644 -o $(ROOTNAME) $(SRCDIR)/doc/fcron.conf.5 $(DESTMAN)/man5
        $(INSTALL) -m 644 -o $(ROOTNAME) $(SRCDIR)/doc/fcrontab.1 $(DESTMAN)/man1
        $(INSTALL) -m 644 -o $(ROOTNAME) $(SRCDIR)/doc/fcrontab.5 $(DESTMAN)/man5
+       $(INSTALL) -m 644 -o $(ROOTNAME) $(SRCDIR)/doc/fcron.conf.5 $(DESTMAN)/man5
        $(INSTALL) -m 644 -o $(ROOTNAME) $(SRCDIR)/doc/bitstring.3 $(DESTMAN)/man3
        $(INSTALL) -m 644 -o $(ROOTNAME) doc/README doc/LICENSE doc/CHANGES doc/*.html \
                 $(DESTDOC)/fcron-$(VERSION)/
index 255f2a4ab08cea8230c9ea29b7ae5f31a1ed0684..5eac7900cff813ddcbae214ba145eaa4b151587d 100755 (executable)
@@ -4,15 +4,16 @@
 #  them if necessary.
 #
 
-# $Id: user-group,v 1.8 2001-03-07 19:32:21 thib Exp $
+# $Id: user-group,v 1.9 2001-07-09 13:12:08 thib Exp $
 
-# take 3 arguments :   username
+# take 4 arguments :   username
 #                      groupname
 #                       automatic answer
+#                       the src dir
 
 PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
 
-if test $# -ne 3; then
+if test $# -ne 4; then
     echo "Too few/many arguments"
     exit 1
 fi
@@ -20,6 +21,7 @@ fi
 USERNAME=$1
 GROUPNAME=$2
 ANSWER=$3
+SRCDIR=$4
 
 INSTALL="nothing"
 INSTALLED=0
@@ -36,8 +38,8 @@ else
   CMD="groupadd $GROUPNAME"
 fi
 
-echo -n "Checking if $GROUPNAME is in /etc/group ... "
-if grep "^$GROUPNAME:" /etc/group > /dev/null; then
+echo -n "Checking if group $GROUPNAME exists ... "
+if $SRCDIR/script/has_group.pl $GROUPNAME; then
   echo "yes."
   INSTALLED=1
 else
@@ -53,6 +55,7 @@ else
     do
       echo "Would you like to add $GROUPNAME in /etc/passwd with the following command ?"
       echo "    $CMD"
+      echo "If you use NYS, ldap, or similar, you should add the group manually (say no here)"
       echo -n "Please answer with 'y' or 'n' (default: 'y'): "
       read INSTALL NOTHING
     done
@@ -84,8 +87,8 @@ GID="`cat /etc/group | grep fcron | awk -F ":" '{print $3}'`"
 INSTALL="nothing"
 INSTALLED=0
 
-echo -n "Checking if $USERNAME is in /etc/passwd ... "
-if grep "^$USERNAME:" /etc/passwd > /dev/null; then
+echo -n "Checking if user $USERNAME exists ... "
+if $SRCDIR/script/has_user.pl $USERNAME; then
   echo "yes."
   INSTALLED=1
 else
@@ -109,6 +112,7 @@ else
     do
       echo "Would you like to add $USERNAME in /etc/passwd with the following command ?"
       echo "    $CMD"
+      echo "If you use NYS, ldap, or similar, you should add the user manually (say no here)"
       echo -n "Please answer with 'y' or 'n' (default: 'y'): "
       read INSTALL NOTHING
     done