Gooshie:
I have not put much effort in this, obviously ;_) I might make a better version at some point, but thanks for the feedback, which I'll address now:
The reason I've used /unset at the end, is not because I've used /set anywhere (just look!), but more because for some reason, some stray variables got left behind.
I don't get your whole point about about $network and $server, when have I ever claimed that these are the same? Also, how is it even relevant to this script at all?
Yours seems nice, but doesn't keep track of modes other than +o and +v, which is a shame imho, but might be chosen because you do not find it neccisary.
thanks for the feedback, much appreciated :_)