]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
chroot-shell: Try different directories to cd into.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 27 Nov 2011 18:53:34 +0000 (19:53 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 27 Nov 2011 18:53:34 +0000 (19:53 +0100)
scripts/chroot-shell

index 0d4a61f20771dff6dc6a8578c52985f022fe2c79..de70d77449972905ddc53de841ddf8618006a9ea 100755 (executable)
@@ -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