Mass stopping and starting of servers hosted on panel. This was designed with the intent of running with a github action. Suitable if you're updating lots of servers at once and you quickly need to make the update live. This code is provided AS IS!
main.py <== script file that need to run
config.py <== configuration of server addresses
BARER TOKEN
barer_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' <== replace with actual token
Click on panel username ( for Ptero Panel )
Go to Api Credentials
Create new API key and leave IP blank. Copy API Key and insert into barer_token field in config.py KEY must be admin's KEY
..........................................................................................
For server List in config.py
The last part of url is server identifier make sure to follow the format when adding servers. Esp , the comma at the end. The last server doesn't require comma , <== important
Run with this command in server console "python main.py" or "python3 main.py"