From 55ea9e6e9e1b3bf8cbdf5bb972f9a6b179b332b6 Mon Sep 17 00:00:00 2001 From: plopoyop Date: Sun, 21 Sep 2014 11:52:46 +0200 Subject: [PATCH] Admin user is mandatory --- manifest.json | 4 ++-- scripts/install | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index d368fef..2f75497 100644 --- a/manifest.json +++ b/manifest.json @@ -32,8 +32,8 @@ { "name": "admin", "ask": { - "en": "Choose the default user (must be an existing YunoHost user) leave empty if none", - "fr": "Choisissez l'utilisateur par defaut (doit ĂȘtre un utiliser YunoHost existant) laisser vide pour aucun" + "en": "Choose the default user (must be an existing YunoHost user)", + "fr": "Choisissez l'utilisateur par defaut (doit ĂȘtre un utiliser YunoHost existant)" }, "example": "homer" } diff --git a/scripts/install b/scripts/install index 9f54f3a..e71636e 100755 --- a/scripts/install +++ b/scripts/install @@ -5,6 +5,15 @@ domain=$1 path=$2 admin_user=$3 + +# Check user parameter +sudo yunohost user list --json | grep -q "\"username\": \"$admin_user\"" +if [[ ! $? -eq 0 ]]; then + echo "Wrong user" + exit 1 +fi +sudo yunohost app setting freshrss admin_user -v $admin_user + # Check domain/path availability sudo yunohost app checkurl $domain$path -a freshrss if [[ ! $? -eq 0 ]]; then