Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
knockd and multiple start/stop commands [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
njcwotx
Guru
Guru


Joined: 25 Feb 2005
Posts: 587
Location: Texas

PostPosted: Mon Feb 14, 2011 9:01 pm    Post subject: knockd and multiple start/stop commands [SOLVED] Reply with quote

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
View user's profile Send private message
gerdesj
l33t
l33t


Joined: 29 Sep 2005
Posts: 621
Location: Yeovil, Somerset, UK

PostPosted: Fri Feb 18, 2011 11:12 pm    Post subject: Re: knockd and multiple start/stop commands Reply with quote

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
View user's profile Send private message
njcwotx
Guru
Guru


Joined: 25 Feb 2005
Posts: 587
Location: Texas

PostPosted: Wed Nov 06, 2013 3:46 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum