Улучши удаление и строку статуса VPN

This commit is contained in:
2026-05-19 14:13:33 +03:00
parent 4187cb6544
commit 417138b3b1
6 changed files with 224 additions and 40 deletions

View File

@@ -34,9 +34,31 @@ printf '%s\n' "$status_json" | grep -q '"modules":'
printf '%s\n' "$status_json" | grep -q '"app":'
status_text="$(bash "$ROOT/bin/vpn-lemanapro.sh" --status)"
printf '%s\n' "$status_text" | grep -q 'Modules:'
printf '%s\n' "$status_text" | grep -q 'core='
printf '%s\n' "$status_text" | grep -q 'app='
printf '%s\n' "$status_text" | grep -q 'autostart='
uninstall_home="$TMP_DIR/uninstall-home"
mkdir -p "$uninstall_home"
uninstall_output="$(
HOME="$uninstall_home" \
LEMANA_VPN_BIN_DIR="$uninstall_home/bin" \
LEMANA_VPN_CONFIG_DIR="$uninstall_home/.config/lemana-vpn" \
OPENCONNECT_LITE_CONFIG_DIR="$uninstall_home/.config/openconnect-lite" \
sh "$ROOT/uninstall.sh" --dry-run --remove-keychain --remove-touchid-helper --remove-openconnect-lite
)"
printf '%s\n' "$uninstall_output" | grep -q 'Начинаю удаление Lemana VPN'
printf '%s\n' "$uninstall_output" | grep -q 'Проверяю runtime-патчи openconnect-lite'
printf '%s\n' "$uninstall_output" | grep -q 'Удаляю sudoers и DNS cleanup wrapper'
printf '%s\n' "$uninstall_output" | grep -q 'Удаляю VPN-записи из macOS Keychain'
if printf '%s\n' "$uninstall_output" | grep -q "$esc"; then
echo "non-tty uninstall dry-run output contains ANSI color codes" >&2
exit 1
fi
fake_pwd="$TMP_DIR/fake-pwd"
mkdir -p "$fake_pwd/bin"
printf 'stale local cli\n' > "$fake_pwd/bin/vpn-lemanapro.sh"