mirror of
https://github.com/YunoHost/example_ynh.git
synced 2024-09-03 20:06:13 +02:00
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:
parent
d27171a82a
commit
7d8075d5a0
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue