Black Friday Black Friday SALE: 40% off every resource until December 1. Shop the sale

Updating and removing

Update the script, keep your messages and remove it cleanly.

On this page

Update#

  1. Stop the script. With PM2, run sudo pm2 stop alwaysmotd. Stopping removes the redirect rules.
  2. Upload the new index.js and package.json over the old ones. Keep your own config.yml.
  3. Run npm install in the folder.
  4. Compare your config.yml with the one in the new zip and copy keys that are new.
  5. Start the script again.

From AlwaysMOTD 1.3 or Calagopus AlwaysMOTD 1.1#

  • deployment.mode is replaced by node. Remove deployment from your file and add node: 'auto' at the top. Without it, auto is used.
  • With auto, a script on a node only handles the servers of that node. On a proxy, set node: 'all'.
  • Pterodactyl v1: give the Application API key read access to Nodes as well, so auto can find the node. Without it, the script warns and handles every node, as before.

Remove#

  1. Stop the script, for example sudo pm2 delete alwaysmotd. This removes the redirect rules.
  2. 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.

Last updated

Still stuck? Open a ticket on the help page or ask in Discord. Mention your version and what you tried.