Files
rustproxy-opnsense-repo/opnsense-plugin/www/rustproxy/+PRE_DEINSTALL.pre
T

14 lines
529 B
Bash
Executable File

#!/bin/sh
# pkg upgrade runs the old package pre-deinstall hook before installing the new
# binary. Stop the supervised child first so the upgrade never leaves an old
# RustProxy process running from an unlinked executable. configctl is preferred
# on OPNsense; the rc.d fallback also works while configd is restarting.
if ! /usr/local/sbin/configctl rustproxy stop >/dev/null 2>&1; then
if [ -x /usr/local/etc/rc.d/rustproxy ]; then
/usr/local/etc/rc.d/rustproxy onestop >/dev/null 2>&1 || true
fi
fi
exit 0