If the mesh peer name is the same as the username then skip the username selection

This commit is contained in:
Bob Mottram 2015-07-28 13:31:31 +01:00
parent a7e76307a5
commit 0eabae8cc9
1 changed files with 17 additions and 12 deletions

View File

@ -579,17 +579,22 @@ function interactive_configuration {
save_configuration_file save_configuration_file
fi fi
data=$(tempfile 2>/dev/null) if [[ $SYSTEM_TYPE == "$VARIANT_MESH" && $DEFAULT_DOMAIN_NAME && -d /home/$DEFAULT_DOMAIN_NAME ]]; then
trap "rm -f $data" 0 1 2 5 15 MY_USERNAME=$DEFAULT_DOMAIN_NAME
dialog --title "Select the user account to install as" \ else
--backtitle "Freedombone Configuration" \ data=$(tempfile 2>/dev/null)
--dselect "/home/$(grep 'MY_USERNAME' temp.cfg | awk -F '=' '{print $2}')" 14 40 2> $data trap "rm -f $data" 0 1 2 5 15
sel=$? dialog --title "Select the user account to install as" \
case $sel in --backtitle "Freedombone Configuration" \
0) MY_USERNAME=$(cat $data | awk -F '/' '{print $3}');; --dselect "/home/$(grep 'MY_USERNAME' temp.cfg | awk -F '=' '{print $2}')" 14 40 2> $data
1) exit 1;; sel=$?
255) exit 1;; case $sel in
esac 0) MY_USERNAME=$(cat $data | awk -F '/' '{print $3}');;
1) exit 1;;
255) exit 1;;
esac
fi
if [ ! $MY_USERNAME ]; then if [ ! $MY_USERNAME ]; then
echo 'No user account was selected' echo 'No user account was selected'
exit 64398 exit 64398
@ -948,7 +953,7 @@ function interactive_configuration {
save_configuration_file save_configuration_file
fi fi
if [[ $SYSTEM_TYPE != $VARIANT_MESH ]]; then if [[ $SYSTEM_TYPE != "$VARIANT_MESH" ]]; then
while [ ! $MY_NAME ] while [ ! $MY_NAME ]
do do
data=$(tempfile 2>/dev/null) data=$(tempfile 2>/dev/null)