#!/bin/bash

RED="\e[31m"
GREEN="\e[32m"
YELLOW="\e[33m"
BLUE="\e[34m"
CYAN="\e[36m"
ENDCOLOR="\e[0m"

pub_ip=$(wget -qO- https://ipecho.net/plain ; echo)

if ! [ $(id -u) = 0 ]; then
   echo -e "${RED}Plese run the command with root privilages!${ENDCOLOR}"
   exit 1
fi

clear
echo -e "          ░█▀▀▀█ ░█▀▀▀█ ░█─── ─█▀▀█ ░█▀▀█ 　 ░█─░█ ░█▀▀▄ ░█▀▀█ " | lolcat
echo -e "          ─▀▀▀▄▄ ─▀▀▀▄▄ ░█─── ░█▄▄█ ░█▀▀▄ 　 ░█─░█ ░█─░█ ░█▄▄█ " | lolcat
echo -e "          ░█▄▄▄█ ░█▄▄▄█ ░█▄▄█ ░█─░█ ░█▄▄█ 　 ─▀▄▄▀ ░█▄▄▀ ░█─── " | lolcat
echo""
echo""
echo -e "$BLUE      ╔═══════════════════════════════════════$BLUE╗"
echo -e "$BLUE      ║            ${YELLOW} ☆ UDP PANEL ☆            $BLUE ║"
echo -e "$BLUE      ╠═══════════════════════════════════════$BLUE╣"
echo -e "${CYAN}      ║  1) Add new users                     ║"
echo -e "      ║  2) View All users                    ║"
echo -e "      ║  3) Edit an existing user             ║"
echo -e "      ║  4) Delete a user                     ║"
echo -e "      ║  5) Server Information                ║"
echo -e "      ║  6) Torrent Blocker                   ║"
echo -e "      ║  7) Remove Script                     ║"
echo -e "      ║  8) About                             ║"
echo -e "      ║  9) Restart System                    ║"
echo -e "      ║  0) Exit                              ║"
echo -e "$BLUE      ╚═══════════════════════════════════════╝"
echo ""
echo -e "       ╔═════════════════════════════════════╗"
echo -e "       ║  MADE WITH LOVE BY PROJECT SSLAB LK ║" | lolcat
echo -e "       ║   2019-2024 © All Rights Reserved.  ║"
echo -e "       ╚═══════════════•⊱✦⊰•═════════════════╝"
echo ""
echo -ne "${GREEN}\n • Select Operation : ${ENDCOLOR}" ;read n

case $n in
  1) /etc/Sslablk/system/Adduser.sh;;
  2) /etc/Sslablk/system/Userlist.sh;;
  3) /etc/Sslablk/system/ChangeUser.sh;;
  4) /etc/Sslablk/system/DelUser.sh;;
  5) clear && screenfetch -p || echo -e "${RED}Screenfetch not installed. please install${ENDCOLOR}"; echo -e "\nPress Enter to return back to the menu";read;menu;;
  6) /etc/Sslablk/system/torrent.sh;;
  7) /etc/Sslablk/system/RemoveScript.sh;;
  8) clear || echo "By Project SSLABLK Dev. Team"; echo -e "\nPress Enter to return back to the menu";read;menu; ;;
  9) systemctl restart udp-custon -p || echo " Restart UDP Custom..."; sleep 3 ; menu ;;
  0) clear;exit;cd $HOME;;
  *) echo -e "${RED}\nInvalid Option. Press Enter to return back to the menu${ENDCOLOR}";read && menu;;
esac