2019-03-23 15:02:15 +00:00
|
|
|
case "$2" in
|
2019-03-31 11:03:13 +00:00
|
|
|
"update")
|
|
|
|
cd /var/www/pterodactyl || exit
|
|
|
|
php artisan down
|
2019-03-31 22:05:30 +00:00
|
|
|
echo "info Fetching latest releases"
|
2019-03-31 11:03:13 +00:00
|
|
|
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
|
2019-03-31 22:05:30 +00:00
|
|
|
echo "info Ensuring permissions are correct"
|
2019-03-31 11:03:13 +00:00
|
|
|
chown -R www-data:www-data ./*
|
|
|
|
chmod -R 755 storage/* bootstrap/cache
|
2019-03-31 22:05:30 +00:00
|
|
|
echo "info Getting latest deps"
|
|
|
|
composer install --no-dev --optimize-autoloader || echo "erro Failed to get deps!"
|
2019-03-23 15:02:15 +00:00
|
|
|
|
2019-03-31 11:03:13 +00:00
|
|
|
artisanfunc=(
|
|
|
|
"view:clear"
|
|
|
|
"cache:clear"
|
|
|
|
"config:cache"
|
|
|
|
"migrate --force"
|
|
|
|
"db:seed --force"
|
|
|
|
"p:migration:clean-orphaned-keys -n"
|
|
|
|
"up"
|
|
|
|
)
|
2019-03-23 15:02:15 +00:00
|
|
|
|
2019-03-31 22:05:30 +00:00
|
|
|
echo "info Running migrations and clearance"
|
2019-03-31 11:03:13 +00:00
|
|
|
for f in "${artisanfunc[@]}"; do
|
2019-03-31 22:05:30 +00:00
|
|
|
php artisan $f || echo "erro Failed to execute 'artisan ${f}'"
|
2019-03-31 11:03:13 +00:00
|
|
|
done
|
|
|
|
;;
|
2019-03-31 22:05:30 +00:00
|
|
|
*); echo "warn Nothing to do";;
|
2019-03-23 15:02:15 +00:00
|
|
|
esac
|