forked from pterodactyl-installer/pterodactyl-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·87 lines (69 loc) · 3.64 KB
/
install.sh
File metadata and controls
executable file
·87 lines (69 loc) · 3.64 KB
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
#!/bin/bash
set -e
######################################################################################
# #
# Project 'pterodactyl-installer' #
# #
# Copyright (C) 2018 - 2024, Vilhelm Prytz, <vilhelm@prytznet.se> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
# #
# https://github.com/pterodactyl-installer/pterodactyl-installer/blob/master/LICENSE #
# #
# This script is not associated with the official Pterodactyl Project. #
# https://github.com/pterodactyl-installer/pterodactyl-installer #
# #
######################################################################################
export GITHUB_SOURCE="v1.0.0"
export SCRIPT_RELEASE="v1.0.0"
export GITHUB_BASE_URL="https://raw.githubusercontent.com/smashyalts/pterodactyl-installer"
LOG_PATH="/var/log/pterodactyl-installer.log"
# check for curl
if ! [ -x "$(command -v curl)" ]; then
echo "* curl is required in order for this script to work."
echo "* install using apt (Debian and derivatives) or yum/dnf (CentOS)"
exit 1
fi
# Always remove lib.sh, before downloading it
rm -rf /tmp/lib.sh
curl -sSL -o /tmp/lib.sh "$GITHUB_BASE_URL"/"$GITHUB_SOURCE"/lib/lib.sh
# shellcheck source=lib/lib.sh
source /tmp/lib.sh
execute() {
echo -e "\n\n* pterodactyl-installer $(date) \n\n" >>$LOG_PATH
[[ "$1" == *"canary"* ]] && export GITHUB_SOURCE="master" && export SCRIPT_RELEASE="canary"
update_lib_source
run_ui "${1//_canary/}" |& tee -a $LOG_PATH
}
welcome ""
done=false
while [ "$done" == false ]; do
actions=(
"panel"
"wings"
"panel;wings"
# "uninstall"
"panel_canary"
"wings_canary"
"panel_canary;wings_canary"
"uninstall_canary"
)
action=2
[ -z "$action" ] && error "Input is required" && continue
valid_input=("$(for ((i = 0; i <= ${#actions[@]} - 1; i += 1)); do echo "${i}"; done)")
[[ ! " ${valid_input[*]} " =~ ${action} ]] && error "Invalid option"
[[ " ${valid_input[*]} " =~ ${action} ]] && done=true && IFS=";" read -r i1 i2 <<<"${actions[$action]}" && execute "$i1" "$i2"
done
# Remove lib.sh, so next time the script is run the, newest version is downloaded.
rm -rf /tmp/lib.sh