From: Michael Tremer Date: Sun, 27 Nov 2011 18:53:34 +0000 (+0100) Subject: chroot-shell: Try different directories to cd into. X-Git-Tag: 0.9.18~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9930c6085f0c778dc1f5aa6b24097bd17b59c78e;p=pakfire.git chroot-shell: Try different directories to cd into. --- diff --git a/scripts/chroot-shell b/scripts/chroot-shell index 0d4a61f20..de70d7744 100755 --- a/scripts/chroot-shell +++ b/scripts/chroot-shell @@ -16,9 +16,12 @@ EOF export PS1="pakfire-chroot \w> " # Change to directory the user will most likely work in -if [ -z "${SOURCE_DIR}" ]; then - SOURCE_DIR="/build" -fi -cd "${SOURCE_DIR}" +for i in ${SOURCE_DIR} /root /; do + if [ -d "${i}" ]; then + cd ${i} + break + fi +done +unset i exec /bin/bash --login