1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rss-bridge_ynh.git synced 2024-09-03 20:25:51 +02:00

More tweaks to make package linter happier

This commit is contained in:
Alexandre Aubin 2020-04-07 14:13:57 +02:00
parent 5cdfee5f23
commit 12dc5fdec4
5 changed files with 9 additions and 21 deletions

View file

@ -31,7 +31,7 @@ exec_as() {
eval $@ eval $@
else else
# use sudo twice to be root and be allowed to use another user # use sudo twice to be root and be allowed to use another user
sudo sudo -u "$USER" "$@" sudo -u "$USER" "$@"
fi fi
} }
@ -65,8 +65,8 @@ WARNING () { # Print on error output
CHECK_SIZE () { # Check if enough disk space available on backup storage CHECK_SIZE () { # Check if enough disk space available on backup storage
file_to_analyse=$1 file_to_analyse=$1
backup_size=$(sudo du --summarize "$file_to_analyse" | cut -f1) backup_size=$(du --summarize "$file_to_analyse" | cut -f1)
free_space=$(sudo df --output=avail "/home/yunohost.backup" | sed 1d) free_space=$(df --output=avail "/home/yunohost.backup" | sed 1d)
if [ $free_space -le $backup_size ] if [ $free_space -le $backup_size ]
then then

View file

@ -4,12 +4,7 @@
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
if [ ! -e _common.sh ]; then source ../settings/scripts/_common.sh
# Fetch helpers file if not in current directory
cp ../settings/scripts/_common.sh ./_common.sh
chmod a+rx _common.sh
fi
source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================

View file

@ -79,7 +79,7 @@ fi
if [ $change_domain -eq 1 ] if [ $change_domain -eq 1 ]
then then
ynh_delete_file_checksum "$nginx_conf_path" ynh_delete_file_checksum "$nginx_conf_path"
sudo mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
# Store file checksum for the new config file location # Store file checksum for the new config file location
ynh_store_file_checksum "/etc/nginx/conf.d/$new_domain.d/$app.conf" ynh_store_file_checksum "/etc/nginx/conf.d/$new_domain.d/$app.conf"
fi fi
@ -90,4 +90,4 @@ fi
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
sudo systemctl reload nginx systemctl reload nginx

View file

@ -19,7 +19,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
db_name=$(ynh_app_setting_get $app db_name) db_name=$(ynh_app_setting_get $app db_name)
domain=$(ynh_app_setting_get "$app" domain)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
@ -34,10 +33,9 @@ ynh_secure_remove "/var/www/$app"
#================================================= #=================================================
# REMOVE NGINX AND PHP-FPM CONFIGURATION # REMOVE NGINX AND PHP-FPM CONFIGURATION
#================================================= #=================================================
# Delete app directory and configurations
ynh_secure_remove --file="/var/www/${app}"
ynh_secure_remove --file="/etc/php5/fpm/pool.d/${app}.conf" ynh_secure_remove --file="/etc/php5/fpm/pool.d/${app}.conf"
[[ -n $domain ]] && sudo ynh_secure_remove --file="/etc/nginx/conf.d/${domain}.d/${app}.conf" ynh_secure_remove --file="/etc/nginx/conf.d/${domain}.d/${app}.conf"
# Reload services # Reload services
systemctl restart php5-fpm systemctl restart php5-fpm

View file

@ -4,12 +4,7 @@
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
if [ ! -e _common.sh ]; then source ../settings/scripts/_common.sh
# Fetch helpers file if not in current directory
cp ../settings/scripts/_common.sh ./_common.sh
chmod a+rx _common.sh
fi
source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================