| View previous topic :: View next topic |
| Author |
Message |
fonce
Joined: 19 Oct 2008 Posts: 4
|
Posted: Sun Oct 19, 2008 1:44 am Post subject: Virtual on/off switch (maybe using ip ban?) |
|
|
Hello,
I was wondering if this is feasible, as I tried it and didn't quite get it to work. I saw in another thread something about the deny-ip file being reloaded automatically, but I remain unsure about that. If one has specified a deny-ip file can they simply put a wildcard on the first line to block everyone and then erase it to allow everyone, using that like an on/off switch? And if so, does it check that file any time a client attempts to connect or does it require a kill -HUP `pid` to reload the file? Honestly either works for me, I'm curious for coding purposes.
I wrote a little web control panel that starts and stops icecast like a service but what I really want to add is the ability to, as simply as possible, prevent anyone from connecting when it's "off" and then remove that block when it's "on", if you will. It'd be trivial to write a piece of PHP or Javascript that will add and remove a wildcard to a text file, so it seems like if my theory is sound then this should work fine.
Alternatively, if the allow list functions differently than the ban list, do the same thing but in reverse for an allow-ip file?
Thoughts? |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sun Oct 19, 2008 3:05 am Post subject: |
|
|
In 2.3.2, those files don't take wildcards, I do have it in my branch work so adding and removing wildcards would work there. We don't read through the file each time, we cache the contents into a lookup tree and only reread on mtime updates.
karl. |
|
| Back to top |
|
 |
fonce
Joined: 19 Oct 2008 Posts: 4
|
Posted: Mon Oct 20, 2008 2:35 pm Post subject: |
|
|
| Perfect! Thank you very much for your help! |
|
| Back to top |
|
 |
fonce
Joined: 19 Oct 2008 Posts: 4
|
Posted: Mon Oct 20, 2008 2:53 pm Post subject: |
|
|
| One more question for you: is there an easier way to do this sort of on/off switch or is this a perfectly reasonable way of doing it? |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Mon Oct 20, 2008 3:05 pm Post subject: |
|
|
I would think that stopping and starting the process would be better, it removes resources when inactive.
karl. |
|
| Back to top |
|
 |
fonce
Joined: 19 Oct 2008 Posts: 4
|
Posted: Mon Oct 20, 2008 9:10 pm Post subject: |
|
|
| Good point. Thanks for your help. |
|
| Back to top |
|
 |
|