Last active
June 25, 2024 10:30
-
-
Save dev-ir/aef266871ca3945a662bd92bbf49b3ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#add color for text | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
YELLOW='\033[0;33m' | |
plain='\033[0m' | |
NC='\033[0m' # No Color | |
# Get server IP | |
SERVER_IP=$(hostname -I | awk '{print $1}') | |
# Fetch server country using ip-api.com | |
SERVER_COUNTRY=$(curl -sS "http://ip-api.com/json/$SERVER_IP" | jq -r '.country') | |
# Fetch server isp using ip-api.com | |
SERVER_ISP=$(curl -sS "http://ip-api.com/json/$SERVER_IP" | jq -r '.isp') | |
cur_dir=$(pwd) | |
# check root | |
[[ $EUID -ne 0 ]] && echo -e "${RED}Fatal error: ${plain} Please run this script with root privilege \n " && exit 1 | |
init(){ | |
clear | |
echo "+-------------------------------------------------------------------------------------------------------------+" | |
echo "| __ __ _ _ _____ _____ _ _ _____ _______ _ _ ______ _____ |" | |
echo "| \ \ / / | | | ||_ _| |_ _|| \ | | / ____||__ __| /\ | | | | | ____|| __ \ |" | |
echo "| \ V / ______ | | | | | | | | | \| || (___ | | / \ | | | | | |__ | |__) | |" | |
echo "| > < |______|| | | | | | | | | . | \___ \ | | / /\ \ | | | | | __| | _ / |" | |
echo "| / . \ | |__| | _| |_ _| |_ | |\ | ____) | | | / ____ \ | |____ | |____ | |____ | | \ \ |" | |
echo "| /_/ \_\ \____/ |_____| |_____||_| \_||_____/ |_| /_/ \_\|______||______||______||_| \_\ |" | |
echo "+-------------------------------------------------------------------------------------------------------------+" | |
echo -e "${GREEN}Server Country:${NC} $SERVER_COUNTRY" | |
echo -e "${GREEN}Server IP:${NC} $SERVER_IP" | |
echo -e "${GREEN}Server ISP:${NC} $SERVER_ISP" | |
echo "+-------------------------------------------------------------------------------------------------+" | |
echo -e "${GREEN}Please choose an option:${NC}" | |
echo "+--------------------------------------------------------------------------------------+" | |
echo -e "${BLUE}| 1 - Alireza" | |
echo -e "${BLUE}| 2 - MHSanaei" | |
echo -e "${BLUE}| 3 - Vaxilu ( Chinese )" | |
echo -e "${BLUE}| 4 - FranzKafkaYu ( English )" | |
echo -e "${BLUE}| 0 - Exit" | |
echo "+--------------------------------------------------------------------------------------+" | |
echo -e "\033[0m" | |
read -p "Enter option number: " choice | |
case $choice in | |
1) | |
clear | |
bash <(curl -Ls https://raw.githubusercontent.com/alireza0/x-ui/master/install.sh) | |
;; | |
2) | |
clear | |
bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) | |
;; | |
3) | |
clear | |
bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh) | |
;; | |
4) | |
clear | |
bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaYu/x-ui/master/install_en.sh) | |
;; | |
0) | |
echo -e "${GREEN}Exiting program...${NC}" | |
exit 0 | |
;; | |
*) | |
echo "Not valid" | |
return_home | |
;; | |
esac | |
} | |
return_home(){ | |
bash <(curl -Ls https://raw.githubusercontent.com/dev-ir/dev-tunnel/master/multi-tunnel.sh) | |
} | |
init |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment