sodosok.sh 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #!/bin/bash
  2. #shadowsocks-libev obfs install by BotVPN
  3. source /etc/os-release
  4. OS=$ID
  5. ver=$VERSION_ID
  6. #Install_Packages
  7. echo "#############################################"
  8. echo "Install Paket..."
  9. apt-get install --no-install-recommends build-essential autoconf libtool libssl-dev libpcre3-dev libev-dev asciidoc xmlto automake -y
  10. echo "Install Paket Selesai."
  11. echo "#############################################"
  12. #Install_Shadowsocks_libev
  13. echo "#############################################"
  14. echo "Install Shadowsocks-libev..."
  15. apt-get install software-properties-common -y
  16. if [[ $OS == 'ubuntu' ]]; then
  17. apt install shadowsocks-libev -y
  18. apt install simple-obfs -y
  19. elif [[ $OS == 'debian' ]]; then
  20. if [[ "$ver" = "9" ]]; then
  21. echo "deb http://deb.debian.org/debian stretch-backports main" | tee /etc/apt/sources.list.d/stretch-backports.list
  22. apt update
  23. apt -t stretch-backports install shadowsocks-libev -y
  24. apt -t stretch-backports install simple-obfs -y
  25. elif [[ "$ver" = "10" ]]; then
  26. echo "deb http://deb.debian.org/debian buster-backports main" | tee /etc/apt/sources.list.d/buster-backports.list
  27. apt update
  28. apt -t buster-backports install shadowsocks-libev -y
  29. apt -t buster-backports install simple-obfs -y
  30. fi
  31. fi
  32. echo "Install Shadowsocks-libev Selesai."
  33. echo "#############################################"
  34. #Server konfigurasi
  35. echo "#############################################"
  36. echo "Konfigurasi Server."
  37. cat > /etc/shadowsocks-libev/config.json <<END
  38. {
  39. "server":"0.0.0.0",
  40. "server_port":8488,
  41. "password":"tes",
  42. "timeout":60,
  43. "method":"aes-256-cfb",
  44. "fast_open":true,
  45. "nameserver":"8.8.8.8",
  46. "mode":"tcp_and_udp",
  47. }
  48. END
  49. echo "#############################################"
  50. #mulai ~shadowsocks-libev~ server
  51. echo "#############################################"
  52. echo "mulai ss server"
  53. systemctl enable shadowsocks-libev.service
  54. systemctl start shadowsocks-libev.service
  55. echo "#############################################"
  56. #buat client config
  57. echo "#############################################"
  58. echo "buat config obfs"
  59. cat > /etc/shadowsocks-libev.json <<END
  60. {
  61. "server":"127.0.0.1",
  62. "server_port":8388,
  63. "local_port":1080,
  64. "password":"",
  65. "timeout":60,
  66. "method":"chacha20-ietf-poly1305",
  67. "mode":"tcp_and_udp",
  68. "fast_open":true,
  69. "plugin":"/usr/bin/obfs-local",
  70. "plugin_opts":"obfs=tls;failover=127.0.0.1:1443;fast-open"
  71. }
  72. END
  73. chmod +x /etc/shadowsocks-libev.json
  74. echo "#############################################"
  75. echo -e "">>"/etc/shadowsocks-libev/akun.conf"
  76. echo "#############################################"
  77. echo "Menambahkan Perintah Shadowsocks-libev"
  78. iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 2443:3543 -j ACCEPT
  79. iptables -I INPUT -m state --state NEW -m udp -p udp --dport 2443:3543 -j ACCEPT
  80. iptables-save > /etc/iptables.up.rules
  81. ip6tables-save > /etc/ip6tables.up.rules
  82. cd /usr/bin
  83. wget -O add-ss "https://raw.githubusercontent.com/alifnurmareta/bc/main/add-ss.sh"
  84. wget -O del-ss "https://raw.githubusercontent.com/alifnurmareta/bc/main/del-ss.sh"
  85. wget -O cek-ss "https://raw.githubusercontent.com/alifnurmareta/bc/main/cek-ss.sh"
  86. wget -O renew-ss "https://raw.githubusercontent.com/alifnurmareta/bc/main/renew-ss.sh"
  87. chmod +x add-ss
  88. chmod +x del-ss
  89. chmod +x cek-ss
  90. chmod +x renew-ss
  91. cd
  92. rm -f /root/sodosok.sh