From: Jim D. <jim...@gm...> - 2007-09-27 19:53:26
|
This is awesome!!! Now i just need the ability to read the args from a file (to allow for multiple cname additions) and then do the soa bump at the end. On 9/27/07, Jamie Cameron <jca...@we...> wrote: > On 27/Sep/2007 12:13 Jim Drash wrote .. > > Here is my problem: > > > > I need to be able to add Aliases (CNAMES) to a Zone file, increment > > the SOA serial number, and apply the changes all from a shell script. > > Is there a way to do this using the underlying capability built into > > webmin without re-writing it? > > You could do this using a perl script - would that be acceptable? The code > would be like : > > #!/usr/bin/perl > $main::no_acl_check++; > $ENV{'WEBMIN_CONFIG'} ||= "/etc/webmin"; > $ENV{'WEBMIN_VAR'} ||= "/var/webmin"; > if ($0 =~ /^(.*\/)[^\/]+$/) { > chdir($1); > } > chop($pwd = `pwd`); > $0 = "$pwd/add-cname.pl"; > require './bind8-lib.pl'; > > $zone = "zonename.com"; > $zonefile = "/var/named/$zone.hosts"; > @recs = &read_zone_file($zonefile, $zone); > &create_record($zonefile, $zone.".", $ARGV[0], "IN", "CNAME", $ARGV[1]); > &bump_soa_record($zonefile, \@recs); > &restart_bind(); > > You could save this as /usr/libexec/webmin/bind8/create-cname.pl , and then > call it with two parameters - the name of the cname, and the value you want. > > - Jamie > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > - > Forwarded by the Webmin mailing list at web...@li... > To remove yourself from this list, go to > http://lists.sourceforge.net/lists/listinfo/webadmin-list > |