1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-28 02:37:09 +00:00

bootstrap: check nixbld group before asking

This commit is contained in:
Daiderd Jordan 2017-07-23 13:50:02 +02:00
parent c5a81146dc
commit d0850bcfbe
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -174,21 +174,24 @@ install(){
echo "If you decide not to, but later change your mind, you can always re-run"
echo -e "this script with "$YELLOW"-u"$ESC" or "$YELLOW"--create-daemon-users"$ESC""
while true ; do
read -p "Would you like to create the Nix daemon group/users? [y/n] " ANSWER
case $ANSWER in
y|Y)
create_daemon_users || exit
break
;;
n|N)
echo "Not creating Nix daemon group/users"
break
;;
*)
echo "Please answer 'y' or 'n'..."
esac
done
if ! dscl . -read /Groups/nixbld PrimaryGroupID &> /dev/null; then
while true; do
read -p "Would you like to create the Nix daemon group/users? [y/n] " ANSWER
case $ANSWER in
y|Y)
create_daemon_users || exit
break
;;
n|N)
echo "Not creating Nix daemon group/users"
break
;;
*)
echo "Please answer 'y' or 'n'..."
;;
esac
done
fi
# Finish
echo -e ""$GREEN"You're all done!"$ESC""