From 80d212570efefa8ba84ad2569887ad31a63542f9 Mon Sep 17 00:00:00 2001 From: Alexis Gavoty Date: Thu, 29 May 2014 12:48:44 +0200 Subject: [PATCH] [fix] Check that admin exists --- scripts/install | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/install b/scripts/install index 6cb7554..eb0976b 100644 --- a/scripts/install +++ b/scripts/install @@ -8,6 +8,13 @@ title=$4 privatelinkbydefault=$5 admin=$6 +# 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 +sudo yunohost app setting shaarli admin -v $admin # Check domain/path availability sudo yunohost app checkurl $domain$path -a shaarli