I have a script that monitors a TCP connection and dumps it to a channel, all working great.
However I would like to have a handler so that when the connection drops, it sleeps for a minute and then reloads the TCL script.
Is there a way to do this, as at present I just call a shell script that restarts the bot but it would be much nicer if I can just reload the specific script that is running.
You should have made the effort to look into that "partyline" stuff. You can do great things with it.
Best solution would however be to contact the writer of the script to reinitialize itself using a timer after the connection dropped. If you are unable to do that, you might want to search for "loadtcl" on these forums.
if the unloadmod and loadmod commands are placed within a proc, there should be no problem using that code. Keep in mind however, that these commands only work with modules, not scripts.
Also, if the proc is created and registered by the module, care would have to be made not to unregister it upon unloading the module.
Noticed that sending the eggdrop SIGHUP causes it to stay connected to the network and in the channel but rehash and reload its TCL scripts.
I'm guessing that your script executes something the moment it is loaded.
Why don't you just place that code in a proc and simply execute that proc on startup and execute it again when the bot is disconnected?
You seem to be to be overdoing it.
"The best solution is often the most simple one"