Coder Social home page Coder Social logo

24-7autostarter's Introduction

Pterodactyl Auto Start

Description

This bash script auto start (at boot for example) the servers in Pterodactyl that have alwaysStart in their description. Modified by NoxShadow YT to migrate to Replit, All credit goes to https://github.com/Alteiria/ for her amazing pterodactylAutoStart.

Requirements

  • You need to set two Secrets in your Replit.:
    • 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

Installation

  1. Generate an account API token: https://your.pterodactyl.panel/account/api
  2. Download the git repository to the /opt/pterodactylAutoStart directory using:
sudo git clone https://github.com/Alteiria/pterodactylAutoStart.git /opt/pterodactylAutoStart
  1. 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
  1. Move the service file from the installation directory to the systemd service files:
sudo mv /opt/pterodactylAutoStart/pterodactylAutoStart.service /etc/systemd/system/pterodactylAutoStart.service
  1. Edit the service file and modify the two environment variables baseURL and apiToken:
sudo nano /etc/systemd/system/pterodactylAutoStart.service

Note: Make sure to follow the Requirements section for the two environment variables!

  1. Enable the service file to make the script starting at boot:
sudo systemctl enable pterodactylAutoStart
  1. 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 second s!

    Screenshot of one of Alteiria server that auto start:

How to test if the script works as intended.

  1. Manually shutdown a server that you configured to auto start.
  2. Run the systemd start command to start the script:
~~sudo systemctl start pterodactylAutoStart~~ Click the run button on Replit.
  1. Check if your server start after that, it will take up to 80 seconds because there is a delay of 60 seconds to abid with Replit's TOS to controll data traffic. (more details available here).
  2. If your server didn't start after that period of 80 seconds check the logs using journalctl:
journalctl -u pterodactylAutoStart

By the way run journalctl in Replit Shell at least once so it will prompt you to install journalctl to replit.nix.

24-7autostarter's People

Contributors

hackeryijia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.