.
This commit is contained in:
@@ -16,13 +16,11 @@ VPN_EMAIL="${VPN_EMAIL:-}"
|
||||
VPN_PASSWORD="${VPN_PASSWORD:-}"
|
||||
VPN_TOTP_SECRET="${VPN_TOTP_SECRET:-}"
|
||||
VPN_HOST="${VPN_HOST:-}"
|
||||
TARGET_IP="${TARGET_IP:-10.3.1.0}"
|
||||
TARGET_IP="${TARGET_IP:-10.3.1.201}"
|
||||
TARGET_SUBNET="$(echo "$TARGET_IP" | cut -d. -f1-3).0/24"
|
||||
VPN_INTERFACE="${VPN_INTERFACE:-tun0}"
|
||||
CONTAINER_NETWORK="172.30.0.0/24"
|
||||
|
||||
# Hardcoded test host (IBM i server)
|
||||
IBMI_HOST="10.3.1.201"
|
||||
|
||||
# Log directory
|
||||
LOG_DIR="/var/log/openconnect-vpn"
|
||||
@@ -181,15 +179,15 @@ get_totp() {
|
||||
oathtool --totp -b "$VPN_TOTP_SECRET"
|
||||
}
|
||||
|
||||
# Test connection to IBMI_HOST
|
||||
# Test connection to TARGET_IP
|
||||
test_connection() {
|
||||
if [[ -z "$IBMI_HOST" ]]; then
|
||||
log WARN "IBMI_HOST not set"
|
||||
if [[ -z "$TARGET_IP" ]]; then
|
||||
log WARN "TARGET_IP not set"
|
||||
return 1
|
||||
fi
|
||||
|
||||
log INFO "Testing connection to $IBMI_HOST..."
|
||||
if ping -c 3 -W 3 "$IBMI_HOST" &>/dev/null; then
|
||||
log INFO "Testing connection to $TARGET_IP..."
|
||||
if ping -c 3 -W 3 "$TARGET_IP" &>/dev/null; then
|
||||
log INFO "Connection test: ${GREEN}SUCCESS${NC}"
|
||||
return 0
|
||||
else
|
||||
@@ -547,7 +545,7 @@ main_menu() {
|
||||
echo -e " ${CYAN}2${NC} - Disconnect VPN"
|
||||
echo -e " ${CYAN}3${NC} - Show VPN status"
|
||||
echo -e " ${CYAN}4${NC} - Setup IP forwarding only"
|
||||
echo -e " ${CYAN}5${NC} - Test connection to $IBMI_HOST"
|
||||
echo -e " ${CYAN}5${NC} - Test connection to $TARGET_IP"
|
||||
echo -e " ${CYAN}6${NC} - Show network status"
|
||||
echo -e " ${CYAN}7${NC} - Show routing table"
|
||||
echo -e " ${CYAN}8${NC} - Show live TOTP"
|
||||
|
||||
Reference in New Issue
Block a user