.
Some checks failed
Test / test (push) Has been cancelled

This commit is contained in:
2026-01-16 22:48:04 +00:00
parent dc463f4cf0
commit b3259d2981

View File

@@ -19,11 +19,12 @@
# Ctrl+4 - Type email + Tab + password (combo) # Ctrl+4 - Type email + Tab + password (combo)
# Ctrl+5 - Full sequence: email + Tab + password + Tab + TOTP + Enter # Ctrl+5 - Full sequence: email + Tab + password + Tab + TOTP + Enter
EMAIL="c-azaw@regoproducts.com" # Credentials from environment variables (set by runtipi)
PASSWORD='Lz@83278327$$@@' EMAIL="${VPN_EMAIL:-}"
TOTP_SECRET="rzqtqskdwkhz6zyr" PASSWORD="${VPN_PASSWORD:-}"
VPN_HOST="vpn-ord1.dovercorp.com" TOTP_SECRET="${VPN_TOTP_SECRET:-}"
TARGET_IP="10.35.33.230" VPN_HOST="${VPN_HOST:-vpn-ord1.dovercorp.com}"
TARGET_IP="${TARGET_IP:-10.35.33.230}"
# Colors # Colors
RED='\033[0;31m' RED='\033[0;31m'
@@ -33,6 +34,14 @@ CYAN='\033[0;36m'
GRAY='\033[0;90m' GRAY='\033[0;90m'
NC='\033[0m' NC='\033[0m'
# Print banner
print_banner() {
echo -e "${CYAN}========================================${NC}"
echo -e "${CYAN} Dover VPN Connection Script ${NC}"
echo -e "${CYAN}========================================${NC}"
echo ""
}
# Flags # Flags
SKIP_AUTO_LOGIN=false SKIP_AUTO_LOGIN=false
DO_CONNECT=false DO_CONNECT=false
@@ -693,33 +702,18 @@ parse_args() {
# Main # Main
parse_args "$@" parse_args "$@"
print_banner
if [ "$DO_DISCONNECT" = "true" ]; then if [ "$DO_DISCONNECT" = "true" ]; then
echo -e "${CYAN}========================================${NC}"
echo -e "${CYAN} Dover VPN Connection Script ${NC}"
echo -e "${CYAN}========================================${NC}"
echo ""
disconnect_vpn disconnect_vpn
exit $? exit $?
fi fi
if [ "$DO_CONNECT" = "true" ]; then if [ "$DO_CONNECT" = "true" ]; then
echo -e "${CYAN}========================================${NC}" start_anyconnect "$( [ "$SKIP_AUTO_LOGIN" = "true" ] && echo "false" || echo "true" )"
echo -e "${CYAN} Dover VPN Connection Script ${NC}"
echo -e "${CYAN}========================================${NC}"
echo ""
if [ "$SKIP_AUTO_LOGIN" = "true" ]; then
start_anyconnect "false"
else
start_anyconnect "true"
fi
exit $? exit $?
fi fi
echo -e "${CYAN}========================================${NC}"
echo -e "${CYAN} Dover VPN Connection Script ${NC}"
echo -e "${CYAN}========================================${NC}"
echo ""
log INFO "Script started" log INFO "Script started"
echo "" echo ""
@@ -738,88 +732,26 @@ else
start_anyconnect "true" start_anyconnect "true"
fi fi
echo ""
main_menu
while true; do while true; do
echo ""
main_menu
echo -ne "${CYAN}Choice: ${NC}" echo -ne "${CYAN}Choice: ${NC}"
read -r choice read -r choice
echo ""
case $choice in case $choice in
1) 1) start_anyconnect "$( [ "$SKIP_AUTO_LOGIN" = "true" ] && echo "false" || echo "true" )" ;;
echo "" 2) copy_to_clipboard ;;
if [ "$SKIP_AUTO_LOGIN" = "true" ]; then 3) show_totp ;;
start_anyconnect "false" 4) setup_forwarding ;;
else 5) log INFO "Testing connection to $TARGET_IP..."
start_anyconnect "true" ping -c 3 "$TARGET_IP" && log INFO "Connection test: ${GREEN}SUCCESS${NC}" || log ERROR "Connection test: ${RED}FAILED${NC}" ;;
fi 6) show_network_status ;;
echo "" 7) kill_cisco_processes ;;
main_menu 8) show_routes ;;
;; 9) show_hosts ;;
2) e|E) edit_hosts ;;
echo "" q|Q) log INFO "Goodbye!"; exit 0 ;;
copy_to_clipboard *) log ERROR "Invalid choice" ;;
echo ""
main_menu
;;
3)
echo ""
show_totp
echo ""
main_menu
;;
4)
echo ""
setup_forwarding
echo ""
main_menu
;;
5)
echo ""
log INFO "Testing connection to $TARGET_IP..."
if ping -c 3 "$TARGET_IP"; then
log INFO "Connection test: ${GREEN}SUCCESS${NC}"
else
log ERROR "Connection test: ${RED}FAILED${NC}"
fi
echo ""
main_menu
;;
6)
echo ""
show_network_status
main_menu
;;
7)
echo ""
kill_cisco_processes
echo ""
main_menu
;;
8)
echo ""
show_routes
echo ""
main_menu
;;
9)
echo ""
show_hosts
echo ""
main_menu
;;
e|E)
echo ""
edit_hosts
echo ""
main_menu
;;
q|Q)
log INFO "Goodbye!"
exit 0
;;
*)
log ERROR "Invalid choice"
;;
esac esac
done done