-
Notifications
You must be signed in to change notification settings - Fork 5
/
clone.sh
97 lines (89 loc) · 3.54 KB
/
clone.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
function sudocheck () {
if [[ $EUID -ne 0 ]]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ You Must Execute as a SUDO USER (with sudo) or as ROOT!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
exit 0
else
mntcheck
fi
}
function mntcheck() {
mnt=$(cat /var/plexguide/server.hd.path)
if [[ "$mnt" != "/mnt" ]];then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ SORRY !!! MOUNT DOCKER and UPLOAD DOCKER DONT WORKS WITH PROCESSING DISCS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 30
doneokay
else
updatesystem
fi
}
function doneokay() {
echo
read -p 'PRESS [ENTER] ' typed </dev/tty
exit 0
}
function updatesystem() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ This can take a while
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 2
updateall
uppercut
gcloudup
#rclone
clone
}
function updateall() {
package_list="update upgrade dist-upgrade autoremove autoclean"
for i in ${package_list}; do
sudo apt $i -yqq 1>/dev/null 2>&1
echo "$i is running , please wait"
sleep 1
done
}
function uppercut() {
ansiv=$(ansible --version | head -n1 | awk '{print $2}')
if [[ "$ansiv" -lt "2.10" ]]; then
pip uninstall ansible 1>/dev/null 2>&1
pip install ansible-base 1>/dev/null 2>&1
pip install ansible 1>/dev/null 2>&1
python3 -m pip install ansible 1>/dev/null 2>&1
fi
}
function gcloudup() {
gcloudversion=$(gcloud --version | head -n1 | awk '{print $4}')
if [[ "$gcloudversion" -lt "307" ]]; then
curl https://sdk.cloud.google.com > /tmp/install.sh
export CLOUDSDK_CORE_DISABLE_PROMPTS=1
if [[ -d "/root/google-cloud-sdk" ]]; then
rm -rf /root/google-cloud-sdk
fi
bash /tmp/install.sh --disable-prompts
rm -f /tmp/install.sh
fi
}
function rclone() {
curl -fsSL https://raw.githubusercontent.com/hawkinzzz/RCupdate/master/rcupdate.sh | sudo bash
}
function clone() {
sudo rm -rf /opt/pgclone
curl -fsSL https://raw.githubusercontent.com/MatchbookLab/local-persist/master/scripts/install.sh | sudo bash
sudo docker volume create -d local-persist -o mountpoint=/mnt --name=unionfs
sudo git clone --quiet https://github.com/hawkinzzz/PGClonenew.git /opt/pgclone
rm -rf /opt/plexguide/menu/pgclone/pgclone.sh
mv /opt/pgclone/newpgclone.sh /opt/plexguide/menu/pgcloner/pgclone.sh
sudo chown -cR 1000:1000 /opt/pgclone/ 1>/dev/null 2>&1
sudo chmod -cR 755 /opt/pgclone 1>/dev/null 2>&1
sudo bash /opt/plexguide/menu/pgcloner/pgclone.sh
}
sudocheck