Please use the new feature in pterodactyl: pterodactyl/panel#136 (comment)
This bash script auto start (at boot for example) the servers in Pterodactyl that have alwaysStart
in their description.
- You need to set two environment variables:
baseURL
: The URL of your Pterodactyl panel +/api
. Example:https://your.pterodactyl.panel/api
apiToken
: The token generated from the Account API page.
- And having jq >1.6 installed: https://github.com/stedolan/jq/releases
- Generate an account API token: https://your.pterodactyl.panel/account/api
- Download the git repository to the
/opt/pterodactylAutoStart
directory using:
sudo git clone https://github.com/Alteiria/pterodactylAutoStart.git /opt/pterodactylAutoStart
- Install JQ from the release page:
sudo wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -O /usr/bin/jq
sudo chmod +x /usr/bin/jq
- Move the service file from the installation directory to the systemd service files:
sudo mv /opt/pterodactylAutoStart/pterodactylAutoStart.service /etc/systemd/system/pterodactylAutoStart.service
- Edit the service file and modify the two environment variables
baseURL
andapiToken
:
sudo nano /etc/systemd/system/pterodactylAutoStart.service
Note: Make sure to follow the Requirements section for the two environment variables!
- Enable the service file to make the script starting at boot:
sudo systemctl enable pterodactylAutoStart
-
On your Pterodactyl panel, edit the description of every server that you wish to auto start by simply adding
alwaysStart
in their description. Watchout for the capitalized in the seconds
!
- Manually shutdown a server that you configured to auto start.
- Run the systemd start command to start the script:
sudo systemctl start pterodactylAutoStart
- Check if your server start after that, it will take up to 80 seconds because there is an hard coded delay in the service file (more details available here).
- If your server didn't start after that period of 80 seconds check the logs using journalctl:
sudo journalctl -u pterodactylAutoStart
If you see some text or errors please open a new issue.