From 7d8075d5a04de474913b40199b51fdb8d7b67f53 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Wed, 8 Feb 2017 11:09:33 +0100 Subject: [PATCH] Check if $app is empty src_path equal to /var/www/$app, so it can't be empty. Even if app is empty, src_path can never be empty. --- scripts/remove | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/remove b/scripts/remove index 4e1c915..83c2f40 100755 --- a/scripts/remove +++ b/scripts/remove @@ -10,10 +10,10 @@ source /usr/share/yunohost/helpers domain=$(ynh_app_setting_get "$app" domain) # Remove sources -# Avoid removing important directory if $app is empty or equal to +# Avoid removing important directory if $app is empty or $src_path equal to # "/" "/var" "/var/www" "/opt" "/home" "/home/yunohost.app" src_path=/var/www/$app -if test -z "$src_path" || [ "/var/www /opt /home/yunohost.app" =~ $src_path ]; then +if test -z "$app" || [ "/var/www /opt /home/yunohost.app" =~ $src_path ]; then echo "Variable src_path seems incomplete, suppression of app directory cancelled." >&2 else sudo rm -rf $src_path