From 9930c6085f0c778dc1f5aa6b24097bd17b59c78e Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 27 Nov 2011 19:53:34 +0100 Subject: [PATCH] chroot-shell: Try different directories to cd into. --- scripts/chroot-shell | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 -- 2.39.5