zapretgui/packaging/linux/deb/prerm
loop-uh 9edcd342a1
All checks were successful
Zapret source guards / validate (push) Successful in 9s
Windows-сборка / Dev Dev 21.1.7.304 опубликован
Linux: the helper service works under systemd, OpenRC and sysvinit (Devuan), chosen by the machine itself
initsys.sh finds the init system (running systemd, then OpenRC, then sysvinit, else none) and installs/starts/stops/removes the service
for it: the unit, an openrc-run script or an LSB script. install.sh, uninstall.sh and the .deb scripts use it; the .deb no longer
depends on systemd; the AppImage asks for the helper's socket instead of systemctl; hints in the program name the command of the
init system found. The OpenRC and the sysv scripts were run for real (Debian 13 chroot with OpenRC, start-stop-daemon).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 09:04:01 -05:00

15 lines
743 B
Shell
Executable file

#!/bin/sh
set -e
if [ "$1" = remove ] || [ "$1" = upgrade ] || [ "$1" = deconfigure ]; then
if [ -r /opt/zapretgui/initsys.sh ]; then
. /opt/zapretgui/initsys.sh
# remove: stop and take the service out (init scripts included); upgrade: only stop, postinst starts it again
if [ "$1" = remove ]; then zg_service_remove || true; else zg_service_stop || true; fi
elif [ -d /run/systemd/system ]; then
systemctl stop zapretgui-helper.service || true
[ "$1" = remove ] && systemctl disable zapretgui-helper.service || true
fi
# the helper removes its table when it stops; this is the second net, so no rule outlives the program
command -v nft >/dev/null && nft delete table inet zapretgui 2>/dev/null || true
fi
exit 0