Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- user='zero'
- domain='exebutcher.ga'
- server_template='https://pastebin.com/raw/wz5BugFv'
- client_template='https://pastebin.com/raw/18hJwFmG'
- renew_script='https://pastebin.com/raw/hbACM8V3'
- systemd_service_template='https://pastebin.com/raw/Mtm3A0K2'
- systemd_timer='https://pastebin.com/raw/jLGTRSNc'
- sudo apt install shadowsocks-libev simple-obfs certbot haveged curl pwgen dos2unix
- password=$(pwgen -cns 32 1)
- sudo apt autoremove
- wget https://github.com/shadowsocks/v2ray-plugin/releases/download/v1.1.0/v2ray-plugin-linux-amd64-v1.1.0.tar.gz
- tar -xvf v2ray-plugin-linux-amd64-v1.1.0.tar.gz
- rm v2ray-plugin-linux-amd64-v1.1.0.tar.gz
- sudo systemctl stop shadowsocks-libev
- sudo rm /etc/shadowsocks-libev/config.json
- sudo certbot certonly -n --standalone --force-renewal -d $domain --agree-tos --email email@sobaka.net
- mkdir /home/$user/certs
- list=("cert.pem" "chain.pem" "fullchain.pem" "privkey.pem")
- for i in "${list[@]}"; do sudo cp /etc/letsencrypt/live/$domain/$i /home/$user/certs/; done
- sudo chown $user:$user /home/$user/certs/*
- chmod 644 /home/$user/certs/*
- sudo setcap 'cap_net_bind_service=+ep' /usr/bin/ss-server
- sudo setcap 'cap_net_bind_service=+ep' /home/$user/v2ray-plugin_linux_amd64
- curl $server_template > tmp.cfg
- dos2unix tmp.cfg
- sed -i "s/pw_placeholder/$password/g" tmp.cfg
- sed -i "s/user_placeholder/$user/g" tmp.cfg
- sed -i "s/domain_placeholder/$domain/g" tmp.cfg
- sudo mv tmp.cfg /etc/shadowsocks-libev/config.json
- sudo systemctl start shadowsocks-libev
- curl $client_template > client.json
- dos2unix client.json
- sed -i "s/password_placeholder/$password/g" client.json
- sed -i "s/domain_placeholder/$domain/g" client.json
- sed -i "s/ip_placeholder/$(curl -s 2ip.ru)/g" client.json
- curl $systemd_service_template > tmp
- dos2unix tmp
- sed -i "s/user_placeholder/$user/g" tmp
- sed -i "s/domain_placeholder/$domain/g" tmp
- sudo mv tmp /etc/systemd/system/cert-renew.service
- sudo wget $systemd_timer -O /etc/systemd/system/cert-renew.timer
- sudo dos2unix /etc/systemd/system/cert-renew.timer
- sudo wget $renew_script -O /opt/renew.sh
- sudo dos2unix /opt/renew.sh
- sudo systemctl daemon-reload
- sudo systemctl start cert-renew.timer
- sudo systemctl enable cert-renew.timer
- echo Client config in client.json:
- cat client.json
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement