View previous topic :: View next topic |
Author |
Message |
njcwotx Guru
Joined: 25 Feb 2005 Posts: 587 Location: Texas
|
Posted: Mon Feb 14, 2011 9:01 pm Post subject: knockd and multiple start/stop commands [SOLVED] |
|
|
Greets
I have a working knockd installation. I am creating a new knock to open some firewall ports; however, I have to implement multiple commands and the subsequently disable new connections after a few seconds.
Anyone done this? I suppose, I can call another set of scripts once with one line, or is there a way to enter the multiple commands in the knockd.conf with 2 start_command lines and 2 stop_command lines or separated by commas, slashes, colons or semi-colons. _________________ Drinking from the fountain of knowldege.
Sometimes sipping.
Sometimes gulping.
Always thirsting.
Last edited by njcwotx on Wed Nov 06, 2013 3:46 am; edited 1 time in total |
|
Back to top |
|
|
gerdesj l33t
Joined: 29 Sep 2005 Posts: 621 Location: Yeovil, Somerset, UK
|
Posted: Fri Feb 18, 2011 11:12 pm Post subject: Re: knockd and multiple start/stop commands |
|
|
njcwotx wrote: | Greets
I have a working knockd installation. I am creating a new knock to open some firewall ports; however, I have to implement multiple commands and the subsequently disable new connections after a few seconds.
Anyone done this? I suppose, I can call another set of scripts once with one line, or is there a way to enter the multiple commands in the knockd.conf with 2 start_command lines and 2 stop_command lines or separated by commas, slashes, colons or semi-colons. |
Never tried knockd myself but I would certainly create separate scripts and call them say /usr/local/bin/knockd-<function>.sh .
Then you can test each one individually.
Cheers
Jon |
|
Back to top |
|
|
njcwotx Guru
Joined: 25 Feb 2005 Posts: 587 Location: Texas
|
Posted: Wed Nov 06, 2013 3:46 am Post subject: |
|
|
Got it to work this way...
start_command = /sbin/iptables blah blah blah && other | commands go here
script.sh did work but the %IP% variable did not pass through properly. && and | however can use those values as well. _________________ Drinking from the fountain of knowldege.
Sometimes sipping.
Sometimes gulping.
Always thirsting. |
|
Back to top |
|
|
|