dynupdate.sh

who, what, where, why, when, how:

who: this script was made by MeaTLoTioN for the large script that is fully functional.  the smaller script has been included for reference, which also works just fine but has less of the finer points of ML's code.  MeaTLoTioN's code is to be considered the final verson of this mod, but the simpler code is useful to easily see how this code could function in a trimmed-down version.  The small condensed code is written by ChatGPT with modifications by warmfuzzy and meant for Linux systems.  It has been tested on Ubuntu/Linux.  This is a PHATstar production.  MeaTLoTioN's code is his own, without having used ChatGPT.  ChatGPT can help out with simpler code but can not write the quality of code that ML has done here.

what: this is a bash shell script meant for used on Linux Mystic BBSes and placed in the Mystic Events section of it's configuration.

where: you can pick this code up from Anonymous Archivers File Distro Network, The Quantum Wormhole BBS [bbs.erb.pw:23]  or the file section of PHATstar.net.  This can be used anywere you please, it is released under the GNU Public License (GPL).

why: this code allows for an auto update of IP addresses in Mystic BBS, so that if you need to whitelist someone on your bbs and they don't have a static IP their system's IP will still be known to the Mystic BBS in question.  This works for sysop's BBSes who need to whitelist a user who has a dynamic IP address.

when: the mod can be placed in the /mystic directory (or whatever directory that Mystic BBS has been installed in), the mod will then need execute permissions, such as:
chmod 777 ./dynupdate.sh
and then be placed in the Mystic Events section of the
./mystic -cfg
configuration settings screen (see the picture of this included in this package) [events.jpg].

how: the script pings the dynamic IP address of a board, makes note of that IP address and compares it to the full text of IP's already in that document.  If it detects the same IP there it will leave it alone and exit.  If the IP address isn't there it will add it to the file to whitelist the dynamic IP to the current IP.  The update frequency can be configured in the Events part of ./mystic -cfg. The actual code by MeaTLoTioN is more complex than I have described, but this is the basics of it.  With the basic script it just keeps adding lines of IP's to the address list while ML's code doesn't leave old IP addresses there; MeaTLoTioN's code is cleaner in that it doesn't leave old IP's that have been detected previously.