Commit 188e04ef authored by Natanael Copa's avatar Natanael Copa

setup-lbu: fix prompt

- encapsulate the alternatives in ''
- strip whitespacee from alternatives and separate with ,
- fix prompt
parent a424dd73
......@@ -103,13 +103,16 @@ suggestion="none"
for dir in /media/*; do
[ -d "$dir" ] || continue
[ "$dir" = "/media/cdrom" ] && continue
alternatives="$alternatives ${dir#/media/}"
alternatives="$alternatives, '${dir#/media/}'"
if is_mounted $dir; then
suggestion=${dir#/media/}
[ -n "$quiet" ] && media=$suggestion
fi
done
# strip leading , + space
alternatives=${alternatives#, }
# if nothing is mounted (or boot from cdrom)
usbmnt=$(awk '$1 == "/dev/usbdisk" {print $2}' /proc/mounts)
if [ -z "$suggestion" ] && [ -n "$usbmnt" ]; then
......@@ -120,7 +123,7 @@ if [ -z "$suggestion" ] && [ -n "$usbmnt" ]; then
fi
while [ -z "$media" ]; do
echo "Where would you like to store configs? ($alternatives or none) [$suggestion] "
echo -n "Enter where to store configs ($alternatives or 'none') [$suggestion]: "
default_read media $suggestion
if [ "$media" = "none" ] || [ -d "/media/$media" ]; then
break
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment