Single user case
This commit is contained in:
parent
f6eb49cffa
commit
48d3d3f2f2
|
@ -702,20 +702,27 @@ function interactive_configuration {
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" && $DEFAULT_DOMAIN_NAME && -d /home/$DEFAULT_DOMAIN_NAME ]]; then
|
no_of_users=$(find /home/* -maxdepth 0 -type d | wc -l)
|
||||||
MY_USERNAME=$DEFAULT_DOMAIN_NAME
|
if [ $no_of_users -eq 1 ]; then
|
||||||
|
# only a single user on the system
|
||||||
|
MY_USERNAME=$(ls /home)
|
||||||
else
|
else
|
||||||
data=$(tempfile 2>/dev/null)
|
# select one from a number of users
|
||||||
trap "rm -f $data" 0 1 2 5 15
|
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" && $DEFAULT_DOMAIN_NAME && -d /home/$DEFAULT_DOMAIN_NAME ]]; then
|
||||||
dialog --title $"Select the user account to install as" \
|
MY_USERNAME=$DEFAULT_DOMAIN_NAME
|
||||||
--backtitle $"Freedombone Configuration" \
|
else
|
||||||
--dselect "/home/$(grep 'MY_USERNAME' temp.cfg | awk -F '=' '{print $2}')" 14 40 2> $data
|
data=$(tempfile 2>/dev/null)
|
||||||
sel=$?
|
trap "rm -f $data" 0 1 2 5 15
|
||||||
case $sel in
|
dialog --title $"Select the user account to install as" \
|
||||||
0) MY_USERNAME=$(cat $data | awk -F '/' '{print $3}');;
|
--backtitle $"Freedombone Configuration" \
|
||||||
1) exit 1;;
|
--dselect "/home/$(grep 'MY_USERNAME' temp.cfg | awk -F '=' '{print $2}')" 14 40 2> $data
|
||||||
255) exit 1;;
|
sel=$?
|
||||||
esac
|
case $sel in
|
||||||
|
0) MY_USERNAME=$(cat $data | awk -F '/' '{print $3}');;
|
||||||
|
1) exit 1;;
|
||||||
|
255) exit 1;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue