properly using ynh_secure_remove
This commit is contained in:
@@ -29,7 +29,7 @@ function ynh_systemctl()
|
|||||||
|
|
||||||
# Save and release the lock...
|
# Save and release the lock...
|
||||||
cp $LOCKFILE $LOCKFILE.bkp.$$
|
cp $LOCKFILE $LOCKFILE.bkp.$$
|
||||||
rm $LOCKFILE
|
ynh_secure_remove $LOCKFILE
|
||||||
|
|
||||||
# Wait for the end of the action
|
# Wait for the end of the action
|
||||||
wait $SYSCTLACTION
|
wait $SYSCTLACTION
|
||||||
|
|||||||
@@ -39,18 +39,25 @@ firmware_nonfree=$(ynh_app_setting_get $app firmware_nonfree)
|
|||||||
systemctl stop ynh-hotspot
|
systemctl stop ynh-hotspot
|
||||||
systemctl disable ynh-hotspot
|
systemctl disable ynh-hotspot
|
||||||
yunohost service remove ynh-hotspot
|
yunohost service remove ynh-hotspot
|
||||||
rm -f /etc/systemd/system/ynh-hotspot.service /usr/local/bin/ynh-hotspot
|
ynh_secure_remove /etc/systemd/system/ynh-hotspot.service
|
||||||
rm -f /tmp/.ynh-hotspot-*
|
ynh_secure_remove /usr/local/bin/ynh-hotspot
|
||||||
|
for FILE in $(ls /tmp/.ynh-hotspot-*)
|
||||||
|
do
|
||||||
|
ynh_secure_remove "$FILE"
|
||||||
|
done
|
||||||
|
|
||||||
# Update firewall for DHCP
|
# Update firewall for DHCP
|
||||||
yunohost firewall disallow --ipv6 UDP 547
|
yunohost firewall disallow --ipv6 UDP 547
|
||||||
yunohost firewall disallow UDP 67
|
yunohost firewall disallow UDP 67
|
||||||
|
|
||||||
# Remove confs
|
# Remove confs
|
||||||
rm -fr /etc/dnsmasq.dhcpd/
|
ynh_secure_remove /etc/dnsmasq.dhcpd/
|
||||||
rm -f /etc/hostapd/hostapd.conf{.tpl?,}
|
ynh_secure_remove /etc/nginx/conf.d/${domain}.d/wifiadmin.conf
|
||||||
rm -f /etc/nginx/conf.d/${domain}.d/wifiadmin.conf
|
ynh_secure_remove /etc/php5/fpm/pool.d/wifiadmin.conf
|
||||||
rm -f /etc/php5/fpm/pool.d/wifiadmin.conf
|
for FILE in $(ls /etc/hostapd/hostapd.conf{.tpl?,})
|
||||||
|
do
|
||||||
|
ynh_secure_remove "$FILE"
|
||||||
|
done
|
||||||
|
|
||||||
# Remove packages
|
# Remove packages
|
||||||
if [[ $firmware_nonfree == yes ]]; then
|
if [[ $firmware_nonfree == yes ]]; then
|
||||||
@@ -60,8 +67,8 @@ else
|
|||||||
|
|
||||||
# Remove free firmwares
|
# Remove free firmwares
|
||||||
if ! dpkg -l firmware-atheros &> /dev/null; then
|
if ! dpkg -l firmware-atheros &> /dev/null; then
|
||||||
rm -f /lib/firmware/htc_7010.fw
|
ynh_secure_remove /lib/firmware/htc_7010.fw
|
||||||
rm -f /lib/firmware/htc_9271.fw
|
ynh_secure_remove /lib/firmware/htc_9271.fw
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
apt-get --assume-yes --force-yes remove ${packages}
|
apt-get --assume-yes --force-yes remove ${packages}
|
||||||
@@ -71,4 +78,4 @@ systemctl restart php5-fpm
|
|||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
|
||||||
# Remove sources
|
# Remove sources
|
||||||
rm -rf /var/www/wifiadmin/
|
ynh_secure_remove /var/www/wifiadmin/
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ git --work-tree "${tmpdir}/" --git-dir "${tmpdir}/.git/" reset --hard "${gitcomm
|
|||||||
cd "${tmpdir}/scripts/"
|
cd "${tmpdir}/scripts/"
|
||||||
bash ./upgrade
|
bash ./upgrade
|
||||||
|
|
||||||
rm -r "${tmpdir}/"
|
ynh_secure_remove "${tmpdir}/"
|
||||||
|
|||||||
Reference in New Issue
Block a user