Oh awesome thanks, time to wipe out the test VM Thanks -----Original Message----- From: Public [mailto:public-bounces@talk.mikrotik.com.au] On Behalf Of Karl Auer Sent: Sunday, 10 January 2016 1:54 PM To: public@talk.mikrotik.com.au Subject: Re: [MT-AU Public] scripting question On Sun, 2016-01-10 at 02:09 +0000, Alex Samad - Yieldbroker wrote:
Are no miss understanding I have a file fw.rsc which I keep my firewall definition in I use it by going import fw.rsc I would like some of those line to be enabled or disabled based on the hostname .
Yes - use the same technique. Your file fw.rsc would look like this: # Common firewall lines blah blah blah blah blah blah :global hostname [/system identity get name] :if ( $hostname = "rtr" ) \ do={ # Firewall lines for host name "rtr" only bloo bloo bloo bloo bloo bloo } Now when you import fw.rsc, the script will inspect the system name and only apply the "bloo bloo bloo" lines if the system name is "rtr". If you need to intersperse the differences, just have more :if statements. You may also find it useful to use chain names based on the router identity, and insert into appropriate chains with strategically placed :if statements. Regards, K. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Karl Auer (kauer@nullarbor.com.au) work +61 2 64957435 http://www.nullarbor.com.au mobile +61 428 957160 GPG fingerprint: 6D59 8AE6 810D 44E3 7626 7040 4DD6 F89F 3053 4774 Old fingerprint: 9DCA 0903 BCBD 0647 BCCC 2FA7 A35C 57A1 ACF9 00BB _______________________________________________ Public mailing list Public@talk.mikrotik.com.au http://talk.mikrotik.com.au/mailman/listinfo/public_talk.mikrotik.com.au