From: Jim D. <jim...@gm...> - 2007-09-27 19:13:52
|
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? Thanks in advance, Jim D. |
From: Jamie C. <jca...@we...> - 2007-09-27 19:32:46
|
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 |
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 > |
From: Jamie C. <jca...@we...> - 2007-09-27 20:05:35
|
So you want to be able to add multiple cnames with different values to a single zone? - Jamie On 27/Sep/2007 12:53 Jim Drash wrote .. > 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 |
From: Jim D. <jim...@gm...> - 2007-09-28 12:22:25
|
yep On 9/27/07, Jamie Cameron <jca...@we...> wrote: > So you want to be able to add multiple cnames with different values > to a single zone? > > - Jamie > > On 27/Sep/2007 12:53 Jim Drash wrote .. > > 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 > |
From: Jamie C. <jca...@we...> - 2007-09-28 16:33:32
|
In that case, you'd want to replace the create_record line with : open(FILE, $ARGV[0]) || die "failed to open $ARGV[0]"; while(<FILE>) { s/\r|\n//g; ($name, $value) = split(/\s+/); &create_record($zonefile, $zone.".", $name, "IN", "CNAME", $value); } close(FILE); On 28/Sep/2007 05:22 Jim Drash wrote .. > yep > > On 9/27/07, Jamie Cameron <jca...@we...> wrote: > > So you want to be able to add multiple cnames with different values > > to a single zone? > > > > - Jamie > > > > On 27/Sep/2007 12:53 Jim Drash wrote .. > > > 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 > > > > ------------------------------------------------------------------------- > 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 |
From: Jim D. <jim...@gm...> - 2007-09-28 20:36:12
|
perfect! other than the &create_record should read: &create_record($zonefile, $name . "." $zone . ".", "IN", "CNAME", $value); You have made my week. On 9/28/07, Jamie Cameron <jca...@we...> wrote: > In that case, you'd want to replace the create_record line with : > > open(FILE, $ARGV[0]) || die "failed to open $ARGV[0]"; > while(<FILE>) { > s/\r|\n//g; > ($name, $value) = split(/\s+/); > &create_record($zonefile, $zone.".", $name, "IN", "CNAME", $value); > } > close(FILE); > > On 28/Sep/2007 05:22 Jim Drash wrote .. > > yep > > > > On 9/27/07, Jamie Cameron <jca...@we...> wrote: > > > So you want to be able to add multiple cnames with different values > > > to a single zone? > > > > > > - Jamie > > > > > > On 27/Sep/2007 12:53 Jim Drash wrote .. > > > > 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 > > > > > > > ------------------------------------------------------------------------- > > 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 > > ------------------------------------------------------------------------- > 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 > |
From: Dave O. <da...@sy...> - 2007-09-28 22:02:54
|
I have a old old server, started as a regular web server, migrated to Virtualmin when I could, and it has seen many versions which as resulted in many different ways to do things. For instance, the /logs directory, now contains that oh so handy .nodelete file, which didn't exist way back when. My question I guess, is there, or can there be a way for virtualmin to verify the configs of domains that it controls, but hasn't touched for ages? And fix them? Or at least tell me what needs to be fixed? Making sure DNS is right, making sure the /stats is where I want it, making sure that the /stats has a .htaccess that works, etc. etc. etc.... Just wondering. Dave Overton, Owner SYIX.COM da...@sy... (530) 755-1751 x101 Fax (530) 751-8871 800-988-SYIX |
From: Jamie C. <jca...@we...> - 2007-09-28 22:40:26
|
On 28/Sep/2007 15:02 Dave Overton wrote .. > I have a old old server, started as a regular web server, migrated to > Virtualmin when I could, and it has seen many versions which as resulted > in many different ways to do things. > > For instance, the /logs directory, now contains that oh so handy .nodelete > file, which didn't exist way back when. > > My question I guess, is there, or can there be a way for virtualmin to > verify the configs of domains that it controls, but hasn't touched for > ages? And fix them? Or at least tell me what needs to be fixed? > > Making sure DNS is right, making sure the /stats is where I want it, making > sure that the /stats has a .htaccess that works, etc. etc. etc.... This feature actually exists, but only in the Pro version of Virtualmin. However, I will port it to the GPL version in the next release (due in a few days), as it is actually more valuable to GPL installs that are likely to be heavily customized. You'll be able to access it using the Validate Virtual Servers link on the left menu under System Settings. - Jamie |