Automatic script to start shadowsocks-redir and configure routing table
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

install.sh 793B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. link() {
  3. ln -sf $PWD /opt/shadowsocks-auto-redir
  4. cp $PWD/systemd/[email protected] /etc/systemd/system/[email protected]
  5. systemctl daemon-reload
  6. }
  7. unlink() {
  8. rm -rf /opt/shadowsocks-auto-redir
  9. rm -rf /etc/systemd/system/[email protected]
  10. systemctl daemon-reload
  11. }
  12. update() {
  13. rm -rf /etc/systemd/system/[email protected]
  14. cp $PWD/systemd/[email protected] /etc/systemd/system/[email protected]
  15. systemctl daemon-reload
  16. }
  17. # MUST be run as root
  18. if [ `id -u` != "0" ]; then
  19. echo "This script MUST BE run as ROOT"
  20. exit 1
  21. fi
  22. if [[ "$1" == "link" ]]; then
  23. link
  24. elif [[ "$1" == "unlink" ]]; then
  25. unlink
  26. elif [[ "$1" == "update" ]]; then
  27. update
  28. fi