Update and repair image
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
#!/command/with-contenv bash
|
||||
source ContainerTools
|
||||
SNAME=${BASH_SOURCE##*/}
|
||||
WORKDIR="/var/www/pterodactyl"
|
||||
|
||||
# If DBHOST value is present, pause boot until target container is up.
|
||||
if [ -n "$DBHOST" ]; then
|
||||
@@ -27,7 +28,7 @@ fi
|
||||
# Check for persistent storage directory, create file structure if not present.
|
||||
if [ ! -d "/config/storage" ]; then
|
||||
log "Creating storage directory"
|
||||
cat .storage.tmpl | while read line; do
|
||||
cat $WORKDIR/.storage.tmpl | while read line; do
|
||||
mkdir -p "/config/${line}"
|
||||
done
|
||||
fi
|
||||
@@ -42,17 +43,17 @@ fi
|
||||
if [ ! -e /config/pterodactyl.conf ]; then
|
||||
log "Config file does not exist, creating template"
|
||||
log "[WARN] Connect to container and finish setup process"
|
||||
cp .env.example /config/pterodactyl.conf
|
||||
cp $WORKDIR/.env.example /config/pterodactyl.conf
|
||||
log "Generating unique Pterodactyl key"
|
||||
log "$(php artisan key:generate --force --no-interaction)"
|
||||
log "$(php $WORKDIR/artisan key:generate --force --no-interaction)"
|
||||
fi
|
||||
|
||||
# Clear views and autogenerated configs on launch. This is necessary for updates, and doesn't affect non-update launches.
|
||||
log "$(php artisan view:clear)"
|
||||
log "$(php artisan config:clear)"
|
||||
log "$(php $WORKDIR/artisan view:clear)"
|
||||
log "$(php $WORKDIR/artisan config:clear)"
|
||||
log "Checking for database updates, preparing cache"
|
||||
log "[NOTE] This will fail if the database connection has not yet been configured"
|
||||
log "$(php artisan migrate --seed --force)"
|
||||
log "$(php $WORKDIR/artisan migrate --seed --force)"
|
||||
chown -R nginx:nginx /config/
|
||||
|
||||
# Load selected Nginx conf.
|
Reference in New Issue
Block a user