Use array and execute foreach at updating pterodactyl

This commit is contained in:
Alex D. 2018-12-24 16:55:00 +01:00
parent fa99ccfbfe
commit 166d4fd6d4
1 changed files with 14 additions and 14 deletions

28
manager
View File

@ -13,7 +13,7 @@ function maitenance {
rm -v /var/log/nginx/*.*
nginx -s reload
output "info" "Restarting Telegraf to update log files..."
systemctl restart telegraf
systemctl restart telegraf
}
function getlatest () {
@ -22,10 +22,6 @@ function getlatest () {
## Pre-/Suf- fix
function pa () {
php artisan "${1}"
}
function dp () {
docker "${1}" prune -f
}
@ -151,20 +147,15 @@ function dc-handler () {
function update () {
case "$1" in
"panel")
cd /var/www/pterodactyl || exit
pa "down"
(cd "/var/www/pterodactyl" && php artisan down) || exit
curl -L https://github.com/pterodactyl/panel/releases/download/"$(getlatest "Pterodactyl/panel")"/panel.tar.gz | tar --strip-components=1 -xzv
curl -L https://github.com/RXCommunity/RedXen-Panel/archive/"$(getlatest "RXCommunity/RedXen-Panel")".tar.gz | tar --strip-components=1 -xzv
chown -R www-data:www-data ./*
chmod -R 755 storage/* bootstrap/cache
composer install --no-dev --optimize-autoloader
pa "view:clear"
pa "cache:clear"
pa "config:cache"
pa "migrate --force"
pa "db:seed --force"
pa "p:migration:clean-orphaned-keys -n"
pa "up"
for f in "${artisanfunc[@]}"; do
php artisan $f
done
;;
"bot")
cd /root/yagpdb || exit
@ -248,6 +239,15 @@ components=(
"home"
"forum"
)
artisanfunc=(
"view:clear"
"cache:clear"
"config:cache"
"migrate --force"
"db:seed --force"
"p:migration:clean-orphaned-keys -n"
"up"
)
dockercont=$(docker ps)
servicelist=$(systemctl list-units --type=service --state=active | grep -oe ".*\.service")