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.
This commit is contained in:
Maniack Crudelis 2017-02-08 11:09:33 +01:00 committed by GitHub
parent d27171a82a
commit 7d8075d5a0

View file

@ -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