Single user case

This commit is contained in:
Bob Mottram 2015-11-30 15:56:07 +00:00
parent f6eb49cffa
commit 48d3d3f2f2
1 changed files with 20 additions and 13 deletions

View File

@ -702,6 +702,12 @@ function interactive_configuration {
esac esac
done done
else else
no_of_users=$(find /home/* -maxdepth 0 -type d | wc -l)
if [ $no_of_users -eq 1 ]; then
# only a single user on the system
MY_USERNAME=$(ls /home)
else
# select one from a number of users
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" && $DEFAULT_DOMAIN_NAME && -d /home/$DEFAULT_DOMAIN_NAME ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_MESH" && $DEFAULT_DOMAIN_NAME && -d /home/$DEFAULT_DOMAIN_NAME ]]; then
MY_USERNAME=$DEFAULT_DOMAIN_NAME MY_USERNAME=$DEFAULT_DOMAIN_NAME
else else
@ -718,6 +724,7 @@ function interactive_configuration {
esac esac
fi fi
fi fi
fi
if [ ! $MY_USERNAME ]; then if [ ! $MY_USERNAME ]; then
echo $'No user account was selected' echo $'No user account was selected'