Add start pterodactyl panel

This commit is contained in:
Christopher
2023-10-14 18:45:49 -05:00
parent b59755085b
commit c6326e3f74
2 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
# Run command
```bash
bash -c "$(wget -qLO - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/start-pterodactyl-panel/run.sh)"
```

View File

@@ -0,0 +1,47 @@
#!/bin/bash
LOG_FILE="pterodactyl_panel_log.txt"
CONTAINER_ID="pterodactyl-panel"
log() {
local message="$1"
local timestamp=$(date +"%Y-%m-%d %H:%M:%S")
echo "[$timestamp] $message" | tee -a $LOG_FILE
}
generate_key() {
log "Generating key..."
docker exec -it $CONTAINER_ID php artisan key:generate --force
log "Key generated successfully."
}
optimize_cache() {
log "Optimizing Laravel cache..."
docker exec -it $CONTAINER_ID php artisan optimize
log "Laravel cache optimized successfully."
}
prompt_check_login() {
echo "Please check your website URL to see if it shows the login." | tee -a $LOG_FILE
}
create_user() {
read -p "Do you want to create a user now? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
log "Creating a user..."
docker exec -it $CONTAINER_ID php artisan p:user:make
log "User created successfully."
fi
}
main() {
log "Starting script..."
generate_key
optimize_cache
prompt_check_login
create_user
log "Script finished."
}
main