Browse Source

Merge pull request #27 from YunoHost-Apps/testing

Fix missing pihole-FTL.conf
Maniack Crudelis 7 years ago
parent
commit
3f895e260f
3 changed files with 7 additions and 2 deletions
  1. 2 2
      scripts/_common.sh
  2. 1 0
      scripts/install
  3. 4 0
      scripts/upgrade

+ 2 - 2
scripts/_common.sh

@@ -517,7 +517,7 @@ EOF
   ynh_store_file_checksum "$finalfail2banjailconf"
   ynh_store_file_checksum "$finalfail2banjailconf"
   ynh_store_file_checksum "$finalfail2banfilterconf"
   ynh_store_file_checksum "$finalfail2banfilterconf"
 
 
-  systemctl reload fail2ban
+  systemctl restart fail2ban
   local fail2ban_error="$(journalctl -u fail2ban | tail -n50 | grep "WARNING.*$app.*")"
   local fail2ban_error="$(journalctl -u fail2ban | tail -n50 | grep "WARNING.*$app.*")"
   if [ -n "$fail2ban_error" ]
   if [ -n "$fail2ban_error" ]
   then
   then
@@ -532,7 +532,7 @@ EOF
 ynh_remove_fail2ban_config () {
 ynh_remove_fail2ban_config () {
   ynh_secure_remove "/etc/fail2ban/jail.d/$app.conf"
   ynh_secure_remove "/etc/fail2ban/jail.d/$app.conf"
   ynh_secure_remove "/etc/fail2ban/filter.d/$app.conf"
   ynh_secure_remove "/etc/fail2ban/filter.d/$app.conf"
-  systemctl reload fail2ban
+  systemctl restart fail2ban
 }
 }
 
 
 #=================================================
 #=================================================

+ 1 - 0
scripts/install

@@ -176,6 +176,7 @@ ynh_exec_warn_less make install )
 ynh_secure_remove "$FTL_temp_path"
 ynh_secure_remove "$FTL_temp_path"
 
 
 cp "../conf/pihole-FTL.conf" "$pihole_storage"
 cp "../conf/pihole-FTL.conf" "$pihole_storage"
+ynh_store_file_checksum "$pihole_storage/pihole-FTL.conf"	# Enregistre la somme de contrôle du fichier de config
 
 
 cp -a $pihole_local_repo/advanced/pihole-FTL.service /etc/init.d/pihole-FTL
 cp -a $pihole_local_repo/advanced/pihole-FTL.service /etc/init.d/pihole-FTL
 chmod +x /etc/init.d/pihole-FTL
 chmod +x /etc/init.d/pihole-FTL

+ 4 - 0
scripts/upgrade

@@ -152,6 +152,10 @@ then
 	ynh_secure_remove "$FTL_temp_path"
 	ynh_secure_remove "$FTL_temp_path"
 fi
 fi
 
 
+ynh_backup_if_checksum_is_different "$pihole_storage/pihole-FTL.conf"	# Créé un backup du fichier de config si il a été modifié.
+cp "../conf/pihole-FTL.conf" "$pihole_storage"
+ynh_store_file_checksum "$pihole_storage/pihole-FTL.conf"	# Enregistre la somme de contrôle du fichier de config
+
 cp -a $pihole_local_repo/advanced/pihole-FTL.service /etc/init.d/pihole-FTL
 cp -a $pihole_local_repo/advanced/pihole-FTL.service /etc/init.d/pihole-FTL
 chmod +x /etc/init.d/pihole-FTL
 chmod +x /etc/init.d/pihole-FTL
 ynh_exec_warn_less systemctl enable pihole-FTL
 ynh_exec_warn_less systemctl enable pihole-FTL