From 4902c1ebba943e0f9c38b37a53fb794bf877d057 Mon Sep 17 00:00:00 2001 From: Romain Garbage Date: Sun, 26 Feb 2017 19:10:35 +0200 Subject: [PATCH] Update remove script --- scripts/remove | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/scripts/remove b/scripts/remove index ebd64ce..27d3f62 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,7 +1,21 @@ #!/bin/bash -domain=$(sudo yunohost app setting shaarli domain) +# This is a multi-instance app, meaning it can be installed several times independently +# The id of the app as stated in the manifest is available as $YNH_APP_ID +# The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2", ...) +# The app instance name is available as $YNH_APP_INSTANCE_NAME +# - the first time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample +# - the second time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample__2 +# - ynhexample__{N} for the subsequent installations, with N=3,4, ... +# The app instance name is probably what you are interested the most, since this is +# guaranteed to be unique. This is a good unique identifier to define installation path, +# db names, ... +app=$YNH_APP_INSTANCE_NAME -sudo rm -rf /var/www/shaarli -sudo rm -f /etc/nginx/conf.d/$domain.d/shaarli.conf -sudo rm -rf /home/yunohost.app/shaarli/data \ No newline at end of file +domain=$(sudo yunohost app setting $app domain) +www_path=$(sudo yunohost app setting $app path | sed -e 's@^/@@' -e 's@/$@@') + +sudo rm -rf /var/www/$www_path +sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf + +sudo service nginx reload