From 84b1eb3f5d2752b03d3638fa157244ea23d9ee48 Mon Sep 17 00:00:00 2001 From: alexz Date: Sat, 17 Jan 2026 16:33:22 +0000 Subject: [PATCH] . --- apps/cistech-tunnel/shared/openconnect-vpn | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/cistech-tunnel/shared/openconnect-vpn b/apps/cistech-tunnel/shared/openconnect-vpn index e1b9c47..0ed8cb0 100755 --- a/apps/cistech-tunnel/shared/openconnect-vpn +++ b/apps/cistech-tunnel/shared/openconnect-vpn @@ -10,7 +10,7 @@ VPN_TOTP_SECRET="${VPN_TOTP_SECRET:-}" VPN_HOST="${VPN_HOST:-}" TARGET_IP="${TARGET_IP:-}" VPN_INTERFACE="${VPN_INTERFACE:-tun0}" - +IBMI_HOST="10.3.1.201" # Log directory LOG_DIR="/var/log/openconnect-vpn" @@ -164,6 +164,7 @@ show_help() { echo " VPN_HOST VPN server hostname" echo " TARGET_IP Target IP for connectivity test" echo " VPN_INTERFACE TUN interface name (default: tun0)" + echo " IBM_HOST IBM i Host" } get_vpn_interface() { @@ -402,9 +403,9 @@ connect_vpn() { setup_forwarding # Test connection if TARGET_IP is set - if [[ -n "$TARGET_IP" ]]; then - log INFO "Testing connection to $TARGET_IP..." - if ping -c 2 -W 3 "$TARGET_IP" &>/dev/null; then + if [[ -n "$IBMI_HOST" ]]; then + log INFO "Testing connection to $IBMI_HOST..." + if ping -c 2 -W 3 "$IBMI_HOST" &>/dev/null; then log INFO "Connection test: ${GREEN}SUCCESS${NC}" else log WARN "Connection test: ${RED}FAILED${NC}" @@ -513,11 +514,11 @@ while true; do 2) disconnect_vpn ;; 3) check_vpn_status ;; 4) setup_forwarding ;; - 5) if [[ -n "$TARGET_IP" ]]; then - log INFO "Testing connection to $TARGET_IP..." - ping -c 3 "$TARGET_IP" && log INFO "Connection test: ${GREEN}SUCCESS${NC}" || log ERROR "Connection test: ${RED}FAILED${NC}" + 5) if [[ -n "$IBMI_HOST" ]]; then + log INFO "Testing connection to $IBMI_HOST..." + ping -c 3 "$IBMI_HOST" && log INFO "Connection test: ${GREEN}SUCCESS${NC}" || log ERROR "Connection test: ${RED}FAILED${NC}" else - log WARN "TARGET_IP not set" + log WARN "IBMI_HOST not set" fi ;; 6) show_network_status ;; 7) show_routes ;;