From 188e04ef1340fabd8efbff5edfbbbb301b5a6740 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 26 Oct 2011 12:46:34 +0000 Subject: setup-lbu: fix prompt - encapsulate the alternatives in '' - strip whitespacee from alternatives and separate with , - fix prompt --- setup-lbu.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'setup-lbu.in') diff --git a/setup-lbu.in b/setup-lbu.in index 51a165b..1a27657 100755 --- a/setup-lbu.in +++ b/setup-lbu.in @@ -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 -- cgit v1.2.3