OMSHELL to Reload Host Config File or cpan Net::ISC::DHCPd::OMAPI Examples

Glenn Satchell Glenn.Satchell at uniq.com.au
Thu Sep 10 02:33:15 UTC 2009


>Date: Wed, 09 Sep 2009 16:04:56 -0300
>From: Shawn Holland <sholland at sandara.ca>
>Subject: Re: OMSHELL to Reload Host Config File or	cpan	
Net::ISC::DHCPd::OMAPI Examples
>To: Users of ISC DHCP <dhcp-users at lists.isc.org>

--8<---snip--->8--

>I have been successful in implementing a solution using perl / omshell.
>It is a bit more work then just updating the included host conf file and
>restarting dhcpd, but it allows for no downtime which was my main
>concern.
>
>It would be interesting if you could use omshell to run a file like the
>way mysql can execute a sql script. Then you could just generate a
>omshell script and tell omshell to execute all the commands in it.

omshell can read from stdin, so the usual trick is something like this
(corresponds with an example in the omshell man page):

#! /bin/sh

omshell << EOF
new "lease"
set ip-address = 192.168.4.50
open
EOF

Alternatively you can use "expect" to drive things if there may be
different results coming back and you need more flexibility.

regards,
-glenn
--
Glenn Satchell   mailto:glenn.satchell at uniq.com.au | Miss 9: What do you
Uniq Advances Pty Ltd       http://www.uniq.com.au | do at work Dad?
PO Box 70 Paddington NSW Australia 2021            | Miss 6: He just
tel:0409-458-580     fax:02-9380-6416              | types random stuff.




More information about the dhcp-users mailing list