Update#
- Stop the script. With PM2, run
sudo pm2 stop alwaysmotd. Stopping removes the redirect rules. - Upload the new
index.jsandpackage.jsonover the old ones. Keep your ownconfig.yml. - Run
npm installin the folder. - Compare your
config.ymlwith the one in the new zip and copy keys that are new. - Start the script again.
From AlwaysMOTD 1.3 or Calagopus AlwaysMOTD 1.1#
deployment.modeis replaced bynode. Removedeploymentfrom your file and addnode: 'auto'at the top. Without it,autois used.- With
auto, a script on a node only handles the servers of that node. On a proxy, setnode: 'all'. - Pterodactyl v1: give the Application API key read access to Nodes as well, so
autocan find the node. Without it, the script warns and handles every node, as before.
Remove#
- Stop the script, for example
sudo pm2 delete alwaysmotd. This removes the redirect rules. - Delete the folder.
Check that no rules are left:
sudo iptables -t nat -L PREROUTING -n --line-numbers
A leftover rule has redir ports followed by one of your MOTD ports. Remove it with the same command that added it, with -D instead of -A:
sudo iptables -t nat -D PREROUTING -p tcp --dport 25565 -j REDIRECT --to-port 4001
Note
If the script is killed instead of stopped, for example by a crash or kill -9, its rules stay until it starts again. When you remove it after a crash, remove them by hand as shown above.