# knockd and multiple start/stop commands [SOLVED]

## njcwotx

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.

----------

## gerdesj

 *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

----------

## njcwotx

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.

----------

