forked from sparkedhost/pterodactyl-updater
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
79 lines (72 loc) · 2.16 KB
/
install.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
#!/bin/bash
quit() {
echo ""
exit
}
clear
echo ""
echo "Sparked Host Pterodactyl Updater"
echo "Developed by [email protected]"
echo ""
if [ $EUID -ne 0 ]; then
echo "Please run the command with sudo."
quit
fi
if [ ! command -v apt-get &> /dev/null ]; then
echo "This script only works on Debian-based systems."
quit
fi
if [ "$1" = '--help' ]; then
echo "--help - Shows this screen"
echo "--no-dependencies - Skips installing required packages"
quit
fi
if [ "$1" = '--no-dependencies' ] || [ "$2" = '--no-dependencies' ]; then
echo "Skipping dependency install."
else
echo "Installing dependencies.."
apt-get update
apt-get install -y curl jq
fi
echo "Detecting existing installation.."
if [ -d /srv/updater ]; then
echo "Auto update script already installed."
quit
fi
if [ -d /var/www/pterodactyl ]; then
echo "Pterodactyl Panel Installation detected."
if [ ! -d /srv/updater ]; then
echo "Creating folder for scripts.."
mkdir /srv/updater
fi
echo "Downloading Panel update script.."
curl -o /srv/updater/panel.sh https://raw.githubusercontent.com/SparkedHost/Pterodactyl-Updater/develop/panel.sh
echo "Adding Panel update script to crontab.."
crontab -l | {
cat
echo "5 1 */1 * * sh /srv/updater/panel.sh >> /dev/null 2>&1"
} | crontab -
fi
if [ -d /var/lib/pterodactyl ]; then
echo "Pterodactyl Wings Installation detected."
if [ ! -d /srv/updater ]; then
echo "Creating folder for scripts."
mkdir /srv/updater
fi
echo "Downloading Wings update script.."
curl -o /srv/updater/wings.sh https://raw.githubusercontent.com/SparkedHost/Pterodactyl-Updater/develop/wings.sh
echo "Adding Wings update script to crontab.."
crontab -l | {
cat
echo "5 1 */1 * * sh /srv/updater/wings.sh >> /dev/null 2>&1"
} | crontab -
fi
echo "Downloading main update script.."
curl -o /srv/updater/update.sh https://raw.githubusercontent.com/SparkedHost/Pterodactyl-Updater/develop/update.sh
echo "Adding main update script to crontab.."
crontab -l | {
cat
echo "0 1 */1 * * sh /srv/updater/update.sh >> /dev/null 2>&1"
} | crontab -
echo "Installation complete."
quit