-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
40 lines (37 loc) · 1.4 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
cat << "EOF"
_
___ ___ _ __ __ _ ___| |__ _ _ __ _____
/ __|/ _ \| '_ \ / _` / __| '_ \| | | | \ \ /\ / / _ \
\__ \ (_) | | | | (_| \__ \ | | | |_| | \ V V / (_) |
|___/\___/|_| |_|\__, |___/_| |_|\__,_| \_/\_/ \___/
|___/
Author: songshu wo
EOF
cd /root
git clone https://github.com/shzxm/gandi-ddns.git
cd /root/gandi-ddns
pip install -r requirements.txt
cp config-template.txt config.txt
echo -n "Please enter apikey:"
read apikey
echo "Writting apikey..."
sed -i -e "s/apikey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/apikey = ${apikey}/g" config.txt
echo "Please enter domain:"
read domain
echo "Writting domain..."
sed -i -e "s/domain = example.com/domain = ${domain}/g" config.txt
echo "Please enter a_name:"
read a_name
echo "Writting a_name..."
sed -i -e "s/a_name = raspbian/a_name = ${a_name}/g" config.txt
cat /root/gandi-ddns/config.txt
echo "Writting system config..."
wget -O ssr.service https://raw.githubusercontent.com/shzxm/songshu/master/ssr.service.el7
chmod 754 ssr.service && mv ssr.service /usr/lib/systemd/system
echo "@reboot python /root/gandi-ddns/gandi_ddns.py &" >> /var/spool/cron/root
echo "*/15 * * * * python /home/user/gandi_ddns.py" >> /var/spool/cron/root
echo "Starting SSR Node Service..."
systemctl enable ssr && systemctl start ssr