123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- #!/bin/bash
- red='\e[1;31m'
- green='\e[0;32m'
- NC='\e[0m'
- MYIP=$(wget -qO- icanhazip.com);
- echo "Script By geo"
- clear
- if [[ "$IP2" = "" ]]; then
- domain=$(cat /etc/v2ray/domain)
- else
- domain=$IP2
- fi
- IP=$(wget -qO- icanhazip.com);
- lastport1=$(grep "port_tls" /etc/shadowsocks-libev/akun.conf | tail -n1 | awk '{print $2}')
- lastport2=$(grep "port_http" /etc/shadowsocks-libev/akun.conf | tail -n1 | awk '{print $2}')
- if [[ $lastport1 == '' ]]; then
- tls=2443
- else
- tls="$((lastport1+1))"
- fi
- if [[ $lastport2 == '' ]]; then
- http=3443
- else
- http="$((lastport2+1))"
- fi
- echo ""
- echo "Masukkan password"
- until [[ $user =~ ^[a-zA-Z0-9_]+$ && ${CLIENT_EXISTS} == '0' ]]; do
- read -rp "Password: " -e user
- CLIENT_EXISTS=$(grep -w $user /etc/shadowsocks-libev/akun.conf | wc -l)
- if [[ ${CLIENT_EXISTS} == '1' ]]; then
- echo ""
- echo "A client with the specified name was already created, please choose another name."
- exit 1
- fi
- done
- read -p "Expired (hari): " masaaktif
- exp=`date -d "$masaaktif days" +"%d-%m-%Y"`
- created=`date -d "0 days" +"%d-%m-%Y"`
- cat > /etc/shadowsocks-libev/$user-tls.json<<END
- {
- "server":"0.0.0.0",
- "server_port":$tls,
- "password":"$user",
- "timeout":60,
- "method":"aes-256-cfb",
- "fast_open":true,
- "no_delay":true,
- "nameserver":"8.8.8.8",
- "mode":"tcp_and_udp",
- "plugin":"obfs-server",
- "plugin_opts":"obfs=tls"
- }
- END
- cat > /etc/shadowsocks-libev/$user-http.json <<-END
- {
- "server":"0.0.0.0",
- "server_port":$http,
- "password":"$user",
- "timeout":60,
- "method":"aes-256-cfb",
- "fast_open":true,
- "no_delay":true,
- "nameserver":"8.8.8.8",
- "mode":"tcp_and_udp",
- "plugin":"obfs-server",
- "plugin_opts":"obfs=http"
- }
- END
- chmod +x /etc/shadowsocks-libev/$user-tls.json
- chmod +x /etc/shadowsocks-libev/$user-http.json
- systemctl start shadowsocks-libev-server@$user-tls.service
- systemctl enable shadowsocks-libev-server@$user-tls.service
- systemctl start shadowsocks-libev-server@$user-http.service
- systemctl enable shadowsocks-libev-server@$user-http.service
- tmp1=$(echo -n "aes-256-cfb:${user}@${domain}:$tls" | base64 -w0)
- tmp2=$(echo -n "aes-256-cfb:${user}@${domain}:$http" | base64 -w0)
- linkss1="ss://${tmp1}?plugin=obfs-local;obfs=tls;obfs-host=bing.com"
- linkss2="ss://${tmp2}?plugin=obfs-local;obfs=http;obfs-host=bing.com"
- echo -e "### $user $exp
- port_tls $tls
- port_http $http">>"/etc/shadowsocks-libev/akun.conf"
- service cron restart
- clear
- echo -e "=======-Shadowsocks-======="
- echo -e "IP/Host : $IP"
- echo -e "Domain : ${domain}"
- echo -e "Port OBFS TLS : $tls"
- echo -e "Port OBFS HTTP : $http"
- echo -e "Password : $user"
- echo -e "Method : aes-256-cfb"
- echo -e "Created : $created"
- echo -e "Expired : $exp"
- echo -e "==========================="
- echo -e "Link OBFS TLS : $linkss1"
- echo -e "==========================="
- echo -e "Link OBFS HTTP : $linkss2"
- echo -e "==========================="
- echo -e ""
- echo -e ""
|