summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setup-desktop.in10
1 files changed, 8 insertions, 2 deletions
diff --git a/setup-desktop.in b/setup-desktop.in
index 116cd59..ad2a269 100644
--- a/setup-desktop.in
+++ b/setup-desktop.in
@@ -30,9 +30,15 @@ if [ $# -gt 1 ]; then
fi
de="$1"
+
+valid_desktops="xfce gnome none"
+if [ $# -eq 1 ] && ! isin "$de" $valid_desktops; then
+ echo "$de is not a valid desktop" >&2
+ usage "1" >&2
+fi
shift
-while [ $# -ne 1 ] && ! isin "$de" xfce gnome none; do
+while ! isin "$de" $valid_desktops; do
ask "Which desktop environment? ('gnome', 'xfce' or 'none')" none
de="$resp"
done
@@ -61,7 +67,7 @@ case "$de" in
;;
esac
-users=$(awk -F: '{if ($3<65000 && $3 >= 1000) print $1}' "$ROOT"/etc/passwd)
+users=$(awk -F: '{if ($3<65000 && $3 >= 1000) print $1}' "$ROOT"/etc/passwd 2>/dev/null)
if [ -z "$users" ]; then
echo "WARNING: You need to create a user account. Please run:" >&2
echo "" >&2