diff --git a/manifest.json b/manifest.json index 63e4105..23c2744 100644 --- a/manifest.json +++ b/manifest.json @@ -13,7 +13,7 @@ "url": "https://github.com/scith" }, "requirements": { - "yunohost": ">= 2.4.0" + "yunohost": ">= 2.6.4" }, "multi_instance": true, "services": [ diff --git a/scripts/install b/scripts/install index 5c03660..9e5e116 100644 --- a/scripts/install +++ b/scripts/install @@ -9,6 +9,9 @@ app=$YNH_APP_INSTANCE_NAME domain=$YNH_APP_ARG_DOMAIN path=$YNH_APP_ARG_PATH +# Compute parameters +final_path=/home/yunohost.app/$app + # Source YunoHost helpers source /usr/share/yunohost/helpers @@ -16,6 +19,13 @@ source /usr/share/yunohost/helpers sudo yunohost app checkurl "${domain}${path}" -a "$app" \ || ynh_die "Path not available: ${domain}${path}" +# Check system user availability +if ynh_system_user_exists "$app" ; then + ynh_die "System user $app already exists !" +else + ynh_system_user_create "$app" "$final_path" +fi + # Install dependencies sudo apt-get update sudo apt-get install nodejs-legacy npm python-pip python-dev python-lxml python-imaging -y -qq diff --git a/scripts/remove b/scripts/remove index d2caf7a..92c68e4 100644 --- a/scripts/remove +++ b/scripts/remove @@ -17,3 +17,6 @@ sudo rm -f /etc/systemd/system/$app.service # Reload nginx service sudo service nginx reload + +# Remove dedicated system user +ynh_system_user_delete $app