#!/bin/bash set -e ###################################################################################### # # # Project 'ptero-install-zzamcode' # # # # Copyright (C) 2018 - 2026, Vilhelm Prytz, # # Modified by zzamcode # # # # 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://github.com/muhammadtsaqf/ptero-install-zzamcode/blob/main/LICENSE # # # # This script is not associated with the official Pterodactyl Project. # # https://github.com/muhammadtsaqf/ptero-install-zzamcode # # # ###################################################################################### export GITHUB_SOURCE="main" export SCRIPT_RELEASE="v1.3.0" export GITHUB_BASE_URL="https://raw.githubusercontent.com/muhammadtsaqf/ptero-install-zzamcode" LOG_PATH="/var/log/pterodactyl-installer.log" # check for curl if ! [ -x "$(command -v curl)" ]; then echo "* curl sangat dibutuhkan agar skrip ini dapat berjalan." echo "* silakan install menggunakan apt (Debian/Ubuntu) atau yum/dnf (CentOS/Rocky)" exit 1 fi # Always remove lib.sh, before downloading it [ -f /tmp/lib.sh ] && 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* ptero-install-zzamcode $(date) \n\n" >>$LOG_PATH [[ "$1" == *"canary"* ]] && export GITHUB_SOURCE="main" && export SCRIPT_RELEASE="canary" update_lib_source run_ui "${1//_canary/}" |& tee -a $LOG_PATH if [[ -n $2 ]]; then echo -e -n "* Instalasi $1 telah selesai. Apakah Anda ingin melanjutkan ke instalasi $2? (y/N): " read -r CONFIRM if [[ "$CONFIRM" =~ [Yy] ]]; then execute "$2" else error "Instalasi $2 dibatalkan." exit 1 fi fi } welcome "" done=false while [ "$done" == false ]; do options=( "Install Panel" "Install Wings" "Install keduanya [0] dan [1] di mesin yang sama (skrip wings berjalan setelah panel)" "Update Panel (Pembaruan Frontend/UI tanpa instal ulang)" # "Uninstall panel atau wings\n" "Install Panel dengan versi canary dari skrip (versi yang ada di main, mungkin ada bug!)" "Install Wings dengan versi canary dari skrip (versi yang ada di main, mungkin ada bug!)" "Install keduanya [3] dan [4] di mesin yang sama (skrip wings berjalan setelah panel)" "Uninstall panel atau wings dengan versi canary (versi yang ada di main, mungkin ada bug!)" ) actions=( "panel" "wings" "panel;wings" "update" # "uninstall" "panel_canary" "wings_canary" "panel_canary;wings_canary" "uninstall_canary" ) output "Apa yang ingin Anda lakukan?" for i in "${!options[@]}"; do output "[$i] ${options[$i]}" done echo -n "* Masukkan pilihan 0-$((${#actions[@]} - 1)): " read -r action [ -z "$action" ] && error "Input diperlukan!" && continue valid_input=("$(for ((i = 0; i <= ${#actions[@]} - 1; i += 1)); do echo "${i}"; done)") [[ ! " ${valid_input[*]} " =~ ${action} ]] && error "Pilihan tidak valid!" [[ " ${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