1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pluxml_ynh.git synced 2024-09-03 20:16:02 +02:00

[enh] remove and upgrade scripts: use helpers.

This commit is contained in:
Moul 2016-06-18 09:36:30 +00:00
parent 43e1f13202
commit 7716439b3a
2 changed files with 11 additions and 11 deletions

View file

@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
app=$YNH_APP_INSTANCE_NAME
domain=$(sudo yunohost app setting $app domain)
# Source YunoHost helpers # Source YunoHost helpers
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
# Remove sources # Remove sources
sudo rm -rf /var/www/$app sudo rm -rf /var/www/$app

View file

@ -3,16 +3,16 @@
# Exit on command errors and treat unset variables as an error # Exit on command errors and treat unset variables as an error
set -eu set -eu
# Retrieve arguments
app=$YNH_APP_INSTANCE_NAME
domain=$(sudo yunohost app setting $app domain)
path=$(sudo yunohost app setting $app path)
admin=$(sudo yunohost app setting $app admin)
is_public=$(sudo yunohost app setting $app is_public)
# Source YunoHost helpers # Source YunoHost helpers
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
# Retrieve arguments
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
path=$(ynh_app_setting_get $app path)
admin=$(ynh_app_setting_get $app admin)
is_public=$(ynh_app_setting_get $app is_public)
# Remove trailing "/" for next commands # Remove trailing "/" for next commands
path=${path%/} path=${path%/}
@ -45,7 +45,7 @@ sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
# If app is public, add url to SSOWat conf as skipped_uris # If app is public, add url to SSOWat conf as skipped_uris
if [ "$is_public" = "Yes" ]; then if [ "$is_public" = "Yes" ]; then
sudo yunohost app setting $app unprotected_uris -v "/" ynh_app_setting_set $app unprotected_uris "/"
fi fi
# Reload nginx service # Reload nginx service