Common Script
About qnap
History start.sh
1
2
3
4
5
#!/bin/bash
# sleep 3;
# /bin/ln -sf /share/CACHEDEV1_DATA/.qpkg/config/htop/htoprc /root/.config/htop/htoprc &&
/bin/ln -sf /share/CACHEDEV1_DATA/.qpkg/config/bash_history /root/.bash_history
Check IPV6
1
2
3
4
5
6
7
8
#!/bin/bash
ip -6 address show | grep inet6 | awk '/:632/ {print $2}' | cut -d'/' -f1 > /share/CACHEDEV1_DATA/.qpkg/shells/nasyy.html &&
cp /share/CACHEDEV1_DATA/.qpkg/shells/nasyy.html /share/CACHEDEV1_DATA/Container/nginx/www/index.html &&
scp -P 2222 /share/CACHEDEV1_DATA/.qpkg/shells/nasyy.html root@server.com:/home/www/ip/index.html
exit 0
Ssl_deploy
1
2
3
4
5
6
7
8
9
#!/bin/bash
cd /root/.acme.sh/qnap.server.com_ecc &&
cp qnap.server.com.cer /etc/stunnel/backup.cert &&
cp qnap.server.com.key /etc/stunnel/backup.key &&
cat /etc/stunnel/backup.cert /etc/stunnel/backup.key > /etc/stunnel/stunnel.pem &&
/etc/init.d/stunnel.sh restart
exit 0
Ssl_issue
1
2
3
4
5
6
#!/bin/bash
cd /root/.acme.sh &&
./acme.sh --issue -d qnap.server.com --challenge-alias 698example.xyz --dns dns_cf --server letsencrypt --dnssleep 300
# You can remove '--server letsencrypt' use defalut server zerossl.
exit 0
Zerotier check
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
zerotier_process=$(ps -ef |grep 'zerotier-one' | grep -v 'grep' | awk '{print $1}')
#check main programme status
if [[ $zerotier_process = "" ]];then
cd /share/CACHEDEV1_DATA/.qpkg/shells/ &&
sh zerotier_start.sh
echo service start successful!
else
echo service is running!
fi
exit 0
Zerotirer start
1
2
3
4
5
6
#!/bin/bash
zerotier-one -d
exit 0
#/share/CACHEDEV1_DATA/.qpkg/Entware/bin/zerotier-one -d
This post is licensed under CC BY 4.0 by the author.