]> the.earth.li Git - autodns.git/commitdiff
cscvs to tla changeset 10
authorJonathan McDowell <noodles@earth.li>
Wed, 15 Jun 2005 10:41:54 +0000 (10:41 +0000)
committerJonathan McDowell <noodles@earth.li>
Wed, 15 Jun 2005 10:41:54 +0000 (10:41 +0000)
Author: noodles
Date: 2005/05/16 17:24:10
Add MASTER command to allow changing the master server to slave from.

git-archimport-id: noodles@earth.li--pie/autodns--mainline--1.0--patch-9

autodns.pl

index 8e1e20bbfc8c105119adb0422daf14be61031db8..e221c09b407a12ef9b648889953b4e85bf93e59f 100755 (executable)
@@ -5,7 +5,7 @@
 # http://www.earth.li/projectpurple/progs/autodns.html
 # Released under the GPL.
 #
-# $Id: autodns.pl,v 1.9 2005/04/13 17:24:40 noodles Exp $
+# $Id: autodns.pl,v 1.10 2005/05/16 17:24:10 noodles Exp $
 #
 
 use strict;
@@ -456,6 +456,17 @@ zone \"$domain\" {
                } else {
                        print REPLY "Couldn't open $domainlistroot$user: $!\n";
                }
+       } elsif ($inprocess && /^MASTER\s(.*)$/) {
+               if (($priv & 1) != 1) {
+                       print REPLY "You're not authorised to use the MASTER ",
+                               "command.\n";
+               } elsif ($1 =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/) {
+                       $server = $1;
+                       print REPLY "Set master IP address to $1\n";
+               } else {
+                       print REPLY "$1 doesn't look like a valid IPv4 ",
+                               "address to me.\n";
+               }
        } elsif ($inprocess && /^HELP$/) {
                print REPLY "In order to use the service, you will need to send GPG signed\n";
                print REPLY "messages.\n\n";