-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpanel.sh
33 lines (29 loc) · 1.03 KB
/
panel.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
#!/bin/sh
PATH_TO_INSTALLATION=/var/www/pterodactyl
cd $PATH_TO_INSTALLATION
LATEST_VERSION=$(curl --silent https://cdn.pterodactyl.io/releases/latest.json | jq '.panel' | sed 's/"//g')
CURRENT_VERSION=$(php artisan p:info | grep 'Panel Version' | awk '{ print substr ($0, 20 ) }')
if [ "$LATEST_VERSION" = "$CURRENT_VERSION" ]
then
exit
fi
export COMPOSER_ALLOW_SUPERUSER=1;
echo "Setting Panel to maintenance mode.."
php artisan down
echo "Downloading latest Panel files.."
curl -L https://github.com/pterodactyl/panel/releases/latest/download/panel.tar.gz | tar -xzv
echo "Setting permissions.."
chmod -R 755 storage/* bootstrap/cache
echo "Installing Composer dependencies.."
composer install --no-dev --optimize-autoloader
echo "Clearing view and config cache.."
php artisan view:clear
php artisan config:clear
echo "Running migrations.."
php artisan migrate --seed --force
echo "Setting permissions.."
chown -R www-data:www-data *
echo "Restarting queue worker.."
php artisan queue:restart
echo "Restoring Panel functionality.."
php artisan up