1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #!/bin/bash
- # SL
- # ==========================================
- # Color
- RED='\033[0;31m'
- NC='\033[0m'
- GREEN='\033[0;32m'
- ORANGE='\033[0;33m'
- BLUE='\033[0;34m'
- PURPLE='\033[0;35m'
- CYAN='\033[0;36m'
- LIGHT='\033[0;37m'
- # ==========================================
- # Getting
- MYIP=$(wget -qO- ipinfo.io/ip);
- echo "Checking VPS"
- IZIN=$( curl ipinfo.io/ip | grep $MYIP )
- if [ $MYIP = $MYIP ]; then
- echo -e "${NC}${GREEN}Permission Accepted...${NC}"
- else
- echo -e "${NC}${RED}Permission Denied!${NC}";
- echo -e "${NC}${LIGHT}Fuck You!!"
- exit 0
- fi
- clear
- tr="$(cat ~/log-install.txt | grep -w "Trojan" | cut -d: -f2|sed 's/ //g')"
- echo -e "======================================"
- echo -e ""
- echo -e "Change Port $tr"
- echo -e ""
- echo -e "======================================"
- read -p "New Port Trojan : " tr2
- if [ -z $tr2 ]; then
- echo "Please Input Port"
- exit 0
- fi
- cek=$(netstat -nutlp | grep -w $tr2)
- if [[ -z $cek ]]; then
- sed -i "s/$tr/$tr2/g" /etc/xray/config.json
- sed -i "s/ - XRAYS Trojan : $tr/ - XRAYS Trojan : $tr2/g" /root/log-install.txt
- iptables -D INPUT -m state --state NEW -m tcp -p tcp --dport $tr -j ACCEPT
- iptables -D INPUT -m state --state NEW -m udp -p udp --dport $tr -j ACCEPT
- iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport $tr2 -j ACCEPT
- iptables -I INPUT -m state --state NEW -m udp -p udp --dport $tr2 -j ACCEPT
- iptables-save > /etc/iptables.up.rules
- iptables-restore -t < /etc/iptables.up.rules
- netfilter-persistent save > /dev/null
- netfilter-persistent reload > /dev/null
- systemctl restart xray.service > /dev/null
- echo -e "\e[032;1mPort $tr2 modified successfully\e[0m"
- else
- echo "Port $tr2 is used"
- fi
|