chiark / gitweb /
make apt-in-chroot work with dash
[dsa-metapackages.git] / apt-in-chroot
index 279b95f9fc773b5fe93aba019ddc6216b2ab43d6..21be495632c0fe00414b5f26ec657f2e799740b9 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # 
 #  apt-in-chroot - runs apt in a specified chroot
 # 
@@ -53,14 +53,11 @@ install|remove|purge|build-dep)
        ;;
 *)
        echo "$APTCMD is not a valid apt sub-command"
+       exit 1
        ;;
 esac
 
-grep -qFx $CHROOT <<< "$VALID_CHROOTS"
-
-RET=$?
-
-if [ "$RET" == "0" ]; then
+if echo "$VALID_CHROOTS" | grep -qFx "$CHROOT"
        # valid chroot
        echo "Will run '/usr/sbin/chroot $CHROOT_DIR/$CHROOT apt-get $APTCMD $PACKAGES'"
        /usr/sbin/chroot $CHROOT_DIR/$CHROOT apt-get $APTCMD $PACKAGES