Harden NordVPN reconciliation and WebGUI testing

This commit is contained in:
ms2k 2026-08-07 02:30:26 +09:00
commit b4a30ca190

23
tests/ui/stop-opnsense.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/sh
set -eu
script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
pid_file="$script_dir/.runtime/launcher.pid"
if [ ! -r "$pid_file" ]; then
rm -f "$script_dir/.runtime/launcher.log"
exit 0
fi
read -r pid < "$pid_file"
case "$pid" in
'' | *[!0-9]*) exit 1 ;;
esac
command=$(ps -p "$pid" -o command= 2>/dev/null || true)
case "$command" in
*"$script_dir/start-opnsense.sh"*)
kill "$pid"
rm -f "$script_dir/.runtime/launcher.log"
;;
*) exit 1 ;;
esac