-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
41 lines (32 loc) · 2.22 KB
/
update.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
41
echo "╭─────────────────────────────────────────────────────────────────╮"
echo "│ │"
echo "│ Starting Update │"
echo "│ [] whiskyBot │"
echo "│ [] whiskySite │"
echo "│ │"
echo "╰─────────────────────────────────────────────────────────────────╯"
pm2 stop whiskyBot
pm2 stop whiskySite
pm2 delete whiskyBot
pm2 delete whiskySite
su -c 'git pull' conrad
bash install.sh
cd whiskyBot
pm2 start index.js --name whiskyBot
cd ..
cd whiskySite
pm2 start index.js --name whiskySite
cd ..
echo "╭─────────────────────────────────────────────────────────────────╮"
echo "│ │"
echo "│ Update Done │"
echo "│ [*] whiskyBot │"
echo "│ [*] whiskySite │"
echo "│ │"
echo "╰─────────────────────────────────────────────────────────────────╯"
echo "Add CertBot hook scripts"
sh -c 'printf "sudo pm2 stop all \n" > /etc/letsencrypt/renewal-hooks/pre/whiskybot.sh'
sh -c 'printf "cd /home/conrad/WhiskyBot \n sudo bash update.sh \n" > /etc/letsencrypt/renewal-hooks/post/whiskybot.sh'
chmod 755 /etc/letsencrypt/renewal-hooks/pre/whiskybot.sh
chmod 755 /etc/letsencrypt/renewal-hooks/post/whiskybot.sh
echo "Finished adding CertBot hook scripts"