Files

55 lines
1.3 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
# WireGuard Secure Installer
# Copyright (c) 2025 Muhammad Fadhila Abiyyu Faris
# GitHub: [github.com/fadhila36/wireguard-secure-installer](https://github.com/fadhila36/wireguard-secure-installer)
# Load Config and Libraries
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/config.env"
source "$SCRIPT_DIR/lib/utils.sh"
source "$SCRIPT_DIR/lib/network.sh"
source "$SCRIPT_DIR/lib/wg_core.sh" # Needed for create_client_config
source "$SCRIPT_DIR/lib/client_mgmt.sh"
check_root
while true; do
clear
echo -e "${BLUE}"
echo "================================================="
echo " WireGuard Management Menu"
echo "================================================="
echo -e "${NC}"
echo "1. Add New Client"
echo "2. Remove Client"
echo "3. View Bandwidth Usage"
echo "4. Exit"
echo ""
echo -n "Select an option [1-4]: "
read -r OPTION
case $OPTION in
1)
new_client
;;
2)
remove_client
;;
3)
view_usage_logs
;;
4)
echo "Exiting..."
exit 0
;;
*)
echo "Invalid option."
sleep 1
;;
esac
echo ""
echo -n "Press Enter to return to menu..."
read -r
done