yalh76 пре 1 година
родитељ
комит
2c8c9dd190
2 измењених фајлова са 14 додато и 2 уклоњено
  1. 7 1
      scripts/install
  2. 7 1
      scripts/upgrade

+ 7 - 1
scripts/install

@@ -130,7 +130,13 @@ _add_cron_jobs
 
 
 _add_logrotate_config
 _add_logrotate_config
 
 
-install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL.service" "/etc/init.d/pihole-FTL"
+install -T -m 0644 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL.systemd" '/etc/systemd/system/pihole-FTL.service'
+if [[ -e '/etc/init.d/pihole-FTL' ]]; then
+    ynh_secure_remove --file="/etc/init.d/pihole-FTL"
+    update-rc.d pihole-FTL remove
+fi
+systemctl daemon-reload
+
 install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL-prestart.sh" "${PI_HOLE_INSTALL_DIR}/pihole-FTL-prestart.sh"
 install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL-prestart.sh" "${PI_HOLE_INSTALL_DIR}/pihole-FTL-prestart.sh"
 install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL-poststop.sh" "${PI_HOLE_INSTALL_DIR}/pihole-FTL-poststop.sh"
 install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL-poststop.sh" "${PI_HOLE_INSTALL_DIR}/pihole-FTL-poststop.sh"
 
 

+ 7 - 1
scripts/upgrade

@@ -174,7 +174,13 @@ _add_cron_jobs
 
 
 _add_logrotate_config
 _add_logrotate_config
 
 
-install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL.service" "/etc/init.d/pihole-FTL"
+install -T -m 0644 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL.systemd" '/etc/systemd/system/pihole-FTL.service'
+if [[ -e '/etc/init.d/pihole-FTL' ]]; then
+    ynh_secure_remove --file="/etc/init.d/pihole-FTL"
+    update-rc.d pihole-FTL remove
+fi
+systemctl daemon-reload
+
 install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL-prestart.sh" "${PI_HOLE_INSTALL_DIR}/pihole-FTL-prestart.sh"
 install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL-prestart.sh" "${PI_HOLE_INSTALL_DIR}/pihole-FTL-prestart.sh"
 install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL-poststop.sh" "${PI_HOLE_INSTALL_DIR}/pihole-FTL-poststop.sh"
 install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL-poststop.sh" "${PI_HOLE_INSTALL_DIR}/pihole-FTL-poststop.sh"
 ynh_exec_warn_less systemctl enable pihole-FTL --quiet
 ynh_exec_warn_less systemctl enable pihole-FTL --quiet