rm -rf -> ynh_secure_remove

This commit is contained in:
Alexandre Aubin 2018-12-03 01:03:15 +01:00 committed by pitchum
parent fc1d305b2b
commit fe159638f5
2 changed files with 11 additions and 12 deletions

View File

@ -31,7 +31,6 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
#================================================= #=================================================
@ -43,18 +42,18 @@ sudo systemctl disable ynh-vpnclient-checker.timer
ynh_systemctl stop ynh-vpnclient ynh_systemctl stop ynh-vpnclient
sudo systemctl disable ynh-vpnclient sudo systemctl disable ynh-vpnclient
sudo yunohost service remove ynh-vpnclient sudo yunohost service remove ynh-vpnclient
sudo rm -f /etc/systemd/system/ynh-vpnclient* /usr/local/bin/ynh-vpnclient* sudo ynh_secure_remove /etc/systemd/system/ynh-vpnclient* /usr/local/bin/ynh-vpnclient*
sudo rm -f /tmp/.ynh-vpnclient-* sudo ynh_secure_remove /tmp/.ynh-vpnclient-*
# Remove confs # Remove confs
sudo rm -f /etc/openvpn/client.conf{.tpl,.tpl.restore,} sudo ynh_secure_remove /etc/openvpn/client.conf{.tpl,.tpl.restore,}
sudo rm -f /etc/nginx/conf.d/${domain}.d/${app}.conf sudo ynh_secure_remove /etc/nginx/conf.d/${domain}.d/${app}.conf
sudo rm -f /etc/php5/fpm/pool.d/${app}.conf sudo ynh_secure_remove /etc/php5/fpm/pool.d/${app}.conf
sudo rm -f /etc/yunohost/hooks.d/90-vpnclient.tpl sudo ynh_secure_remove /etc/yunohost/hooks.d/90-vpnclient.tpl
sudo rm -f /etc/systemd/system/openvpn@.service sudo ynh_secure_remove /etc/systemd/system/openvpn@.service
# Remove certificates # Remove certificates
sudo rm -rf /etc/openvpn/keys/ sudo ynh_secure_remove /etc/openvpn/keys/
# Remove packages # Remove packages
ynh_remove_app_dependencies ynh_remove_app_dependencies
@ -64,8 +63,8 @@ sudo systemctl restart php5-fpm
sudo systemctl reload nginx sudo systemctl reload nginx
# Remove sources # Remove sources
sudo rm -rf /var/www/${app}/ sudo ynh_secure_remove "/var/www/${app}/"
# Removed system user # Removed system user
ynh_system_user_delete ${app} ynh_system_user_delete ${app}
sudo rm -f /etc/sudoers.d/${app}_ynh sudo ynh_secure_remove "/etc/sudoers.d/${app}_ynh"

View File

@ -77,7 +77,7 @@ vpnclient_deploy_files_and_services "${domain}" "${app}"
# Restore previously existing config files # Restore previously existing config files
sudo cp -r ${tmpdir}/client* /etc/openvpn/ sudo cp -r ${tmpdir}/client* /etc/openvpn/
sudo rm -rf ${tmpdir} sudo ynh_secure_remove ${tmpdir}
#================================================= #=================================================
# RELOAD RELEVANT SERVICES # RELOAD RELEVANT SERVICES