Intensify thinking; there must be a way!

518
You continue thinking about this.
But more intensively.
And you have an idea.

One of your scripts asked the server for all files in a specific directory.
It would download the files,
check some things in their content,
perform some actions,
remove the files,
and continue.

Two very important details:
The files are downloaded to the same directory where the script is located.
The files are saved under their original names that they have on your server.

If the server contains a file
which has the same name as the script
and which happens to be a totally different new script
then the script will download it and overwrite itself.
(and probably crash)

Next time when the script is restarted
(you made a periodic task which restarts the script so in case of any problem it can continue from where it stopped)
actually, your new script will be started instead.
And this new script can make a reverse SSH connection to the server at night
(so that you in the past don't notice anything strange)
At the end the new script should overwrite itself with the original script.

"BSTA" by Balthasar Szczepański
Online interface v1.2.8 © Balthasar Szczepański; AGPL 3 license
source code

1190.bicyclesonthemoon.info