Fix check for chroot script directory
authorMichael Prokop <mika@grml.org>
Fri, 21 Nov 2008 11:55:24 +0000 (12:55 +0100)
committerMichael Prokop <mika@grml.org>
Fri, 21 Nov 2008 11:55:24 +0000 (12:55 +0100)
chroot-script
grml-debootstrap

index 072fb4c..e5ea8a3 100755 (executable)
@@ -340,7 +340,7 @@ hostname() {
 
         # listen on loopback interface only:
         sed -i "s/^inet_interfaces = .*/inet_interfaces = loopback-only/" /etc/postfix/main.cf
 
         # listen on loopback interface only:
         sed -i "s/^inet_interfaces = .*/inet_interfaces = loopback-only/" /etc/postfix/main.cf
-        grep inet_interfaces /etc/postfix/main.cf || echo 'inet_interfaces = loopback-only' >> /etc/postfix/main.cf
+        grep -q inet_interfaces /etc/postfix/main.cf || echo 'inet_interfaces = loopback-only' >> /etc/postfix/main.cf
      fi
   fi
 }
      fi
   fi
 }
index 59ee6dd..c90b1b0 100755 (executable)
@@ -765,7 +765,7 @@ preparechroot() {
 
   # copy scripts that should be executed inside the chroot:
   _opt_chroot_scripts=${_opt_chroot_scripts:-$CONFFILES/chroot-scripts/}
 
   # copy scripts that should be executed inside the chroot:
   _opt_chroot_scripts=${_opt_chroot_scripts:-$CONFFILES/chroot-scripts/}
-  [ -f $_opt_chroot_scripts -a "$CHROOT_SCRIPTS" = 'yes' ] && \
+  [ -d $_opt_chroot_scripts -a "$CHROOT_SCRIPTS" = 'yes' ] && \
     cp -a $VERBOSE $_opt_chroot_scripts $MNTPOINT/etc/debootstrap/
 
   # notice: do NOT use $CHROOT_VARIABLES inside chroot but statically file instead!
     cp -a $VERBOSE $_opt_chroot_scripts $MNTPOINT/etc/debootstrap/
 
   # notice: do NOT use $CHROOT_VARIABLES inside chroot but statically file instead!