Skip to content
Snippets Groups Projects
Commit a9d8d057 authored by Bob Mottram's avatar Bob Mottram
Browse files

If there is only one valid user then don't show selection

parent 16187552
No related branches found
No related tags found
No related merge requests found
......@@ -1309,10 +1309,14 @@ function select_user {
fi
done
user_index=$(dialog --backtitle $"Freedombone Configuration" --title $"Select User" --menu $"Select one of the following:" 24 40 17 "${W[@]}" 3>&2 2>&1 1>&3)
if [ $i -eq 1 ]; then
SELECTED_USERNAME="${name[0]}"
else
user_index=$(dialog --backtitle $"Freedombone Configuration" --title $"Select User" --menu $"Select one of the following:" 24 40 17 "${W[@]}" 3>&2 2>&1 1>&3)
if [ $? -eq 0 ]; then
SELECTED_USERNAME="${name[$((user_index-1))]}"
if [ $? -eq 0 ]; then
SELECTED_USERNAME="${name[$((user_index-1))]}"
fi
fi
}
......
......@@ -403,10 +403,14 @@ function select_user {
fi
done
user_index=$(dialog --backtitle $"Freedombone Control Panel" --title $"Select User" --menu $"Select one of the following:" 24 40 17 "${W[@]}" 3>&2 2>&1 1>&3)
if [ $i -eq 1 ]; then
SELECTED_USERNAME="${name[0]}"
else
user_index=$(dialog --backtitle $"Freedombone Control Panel" --title $"Select User" --menu $"Select one of the following:" 24 40 17 "${W[@]}" 3>&2 2>&1 1>&3)
if [ $? -eq 0 ]; then
SELECTED_USERNAME="${name[$((user_index-1))]}"
if [ $? -eq 0 ]; then
SELECTED_USERNAME="${name[$((user_index-1))]}"
fi
fi
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment