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