From 0e7ee80fcd4b3bc22f3ed777726364e2bf6fd3ed Mon Sep 17 00:00:00 2001 From: ewilly Date: Thu, 21 Apr 2016 07:00:24 +0200 Subject: [PATCH] Fix admin user + check that admin user is an existing account + save this setting --- scripts/install | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/install b/scripts/install index 7e67db7..89069fb 100644 --- a/scripts/install +++ b/scripts/install @@ -28,7 +28,15 @@ if [[ ! $? -eq 0 ]]; then exit 1 fi +# check that admin user is an existing account +sudo yunohost user list --json | grep -q "\"username\": \"$admin\"" +if [[ ! $? -eq 0 ]]; then + echo "Error : the chosen admin user does not exist" + exit 1 +fi + # save app settings +sudo yunohost app setting $app admin_user -v "$admin" sudo yunohost app setting $app is_public -v "$is_public" sudo yunohost app setting $app domain -v "$domain" sudo yunohost app setting $app path -v "$path"