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