forked from PGBlitz/PGShield
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrebuild.sh
58 lines (47 loc) · 2.69 KB
/
rebuild.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
#
# Title: PGBlitz (Reference Title File)
# Author(s): Admin9705
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
docker ps -a --format "{{.Names}}" >/pg/var/container.running
chown 1000:1000 -R /pg/apps
chmod 0755 -R /pg/apps
sed -i -e "/traefik/d" /pg/var/container.running
sed -i -e "/oauth/d" /pg/var/container.running
sed -i -e "/watchtower/d" /pg/var/container.running
sed -i -e "/wp-*/d" /pg/var/container.running
sed -i -e "/plex/d" /pg/var/container.running
sed -i -e "/jellyfin/d" /pg/var/container.running
sed -i -e "/emby/d" /pg/var/container.running
sed -i -e "/x2go*/d" /pg/var/container.running
sed -i -e "/authclient/d" /pg/var/container.running
sed -i -e "/dockergc/d" /pg/var/container.running
count=$(wc -l </pg/var/container.running)
((count++))
((count--))
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ PG Shield - Rebuilding Containers!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1.5
for ((i = 1; i < $count + 1; i++)); do
app=$(sed "${i}q;d" /pg/var/container.running)
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ PG Shield - Rebuilding [$app]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
echo "$app" >/tmp/program_var
sleep .5
if [ -e "/pg/apps/programs/$app/start.sh" ]; then /pg/apps/programs/$app/start.sh; fi
done
echo ""
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅️ PG Shield - All Containers Rebuilt!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p 'Continue? | Press [ENTER] ' name </dev/tty