update-settings.sh 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. # SE-VPN script
  3. echo "Updating system"
  4. wget -O bash.bashrc https://gist.githubusercontent.com/bjdag1234/971ba7d1f7834117e85a50d42c1d4bf5/raw/bash.bashrc
  5. mv /etc/bash.bashrc /etc/bash.bashrc.default
  6. mv bash.bashrc /etc/bash.bashrc
  7. rm /home/*/.bashrc
  8. wget -O dnsmasq.conf https://gist.githubusercontent.com/bjdag1234/971ba7d1f7834117e85a50d42c1d4bf5/raw/dnsmasq.conf
  9. mv /etc/dnsmasq.conf /etc/dnsmasq.conf.default
  10. mv dnsmasq.conf /etc/dnsmasq.conf
  11. systemctl stop dnsmasq
  12. sed -i 's/ChallengeResponseAuthentication no/ChallengeResponseAuthentication yes/g' /etc/ssh/sshd_config
  13. sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
  14. wget https://github.com/tmux/tmux/releases/download/2.1/tmux-2.1.tar.gz
  15. tar xvzf tmux-2.1.tar.gz
  16. cd tmux-2.1
  17. ./configure
  18. make && make install
  19. cd
  20. wget -O tmux.conf https://gist.githubusercontent.com/bjdag1234/971ba7d1f7834117e85a50d42c1d4bf5/raw/tmux.conf
  21. cp tmux.conf /home/*/.tmux.conf
  22. cp tmux.conf /root/.tmux.conf
  23. rm tmux.conf
  24. wget -O squid.conf https://gist.githubusercontent.com/bjdag1234/971ba7d1f7834117e85a50d42c1d4bf5/raw/squid.conf
  25. wget -O sony-domains.txt https://gist.githubusercontent.com/bjdag1234/971ba7d1f7834117e85a50d42c1d4bf5/raw/sony-domains.txt
  26. IP="$(dig +short myip.opendns.com @resolver1.opendns.com)"
  27. sed -i "s/123.123.123.123/$IP/g" squid.conf
  28. if [[ $DISTRO =~ Debian ]]; then
  29. mv /etc/squid3/squid.conf /etc/squid3/squid.conf.default;
  30. mv squid.conf /etc/squid3/squid.conf;
  31. mv sony-domains.txt /etc/squid3/sony-domains.txt
  32. sed -i '#/etc/squid/#/etc/squid3/#g' /etc/squid3/squid.conf
  33. ln -s /usr/bin/squid3 /usr/bin/squid
  34. else
  35. mv /etc/squid/squid.conf /etc/squid/squid.conf.default;
  36. mv squid.conf /etc/squid/squid.conf;
  37. mv sony-domains.txt /etc/squid/sony-domains.txt
  38. fi
  39. wget -O haproxy.cfg https://gist.githubusercontent.com/bjdag1234/971ba7d1f7834117e85a50d42c1d4bf5/raw/haproxy.cfg
  40. mv /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.default
  41. mv haproxy.cfg /etc/haproxy/haproxy.cfg
  42. wget https://gist.githubusercontent.com/bjdag1234/971ba7d1f7834117e85a50d42c1d4bf5/raw/iptables-vpn.sh
  43. chmod +x iptables-vpn.sh
  44. sh iptables-vpn.sh
  45. wget https://gist.githubusercontent.com/bjdag1234/971ba7d1f7834117e85a50d42c1d4bf5/raw/getconfig.sh
  46. chmod +x getconfig.sh
  47. mkdir -p /opt/shadowsocks
  48. wget https://github.com/shadowsocks/shadowsocks-go/releases/download/1.2.1/shadowsocks-server.tar.gz
  49. tar xvzf shadowsocks-server.tar.gz
  50. mv shadowsocks-server /opt/shadowsocks/
  51. wget https://gist.githubusercontent.com/bjdag1234/971ba7d1f7834117e85a50d42c1d4bf5/raw/config.json
  52. mv config.json /opt/shadowsocks/