make dyn domain name variable
This commit is contained in:
@@ -255,8 +255,8 @@ def pushmattermost(msg):
|
|||||||
# return: None if ok, else error text
|
# return: None if ok, else error text
|
||||||
def nsupdate(hostname, newip):
|
def nsupdate(hostname, newip):
|
||||||
D = {}
|
D = {}
|
||||||
D['domain'] = 'dy.wapanafa.org'
|
D['domain'] = dyndomain
|
||||||
D['fqdn'] = '%s.dy.wapanafa.org' % hostname
|
D['fqdn'] = dynfqdn % hostname
|
||||||
D['dnsttl'] = '5'
|
D['dnsttl'] = '5'
|
||||||
D['newip'] = newip
|
D['newip'] = newip
|
||||||
D['ts'] = time.strftime('%Y-%m-%d.%H:%M:%S', time.gmtime())
|
D['ts'] = time.strftime('%Y-%m-%d.%H:%M:%S', time.gmtime())
|
||||||
@@ -808,6 +808,8 @@ PUSHSRVS = ["all", "pushover", "mattermost" ]
|
|||||||
helpflag = False
|
helpflag = False
|
||||||
forground = False
|
forground = False
|
||||||
pushsrv = "pushover" # mattermost
|
pushsrv = "pushover" # mattermost
|
||||||
|
dyndomain = "wapanafa.org"
|
||||||
|
dynfqdn = "%s.dy.wapanafa.org"
|
||||||
optlist = []
|
optlist = []
|
||||||
args = []
|
args = []
|
||||||
home = os.environ['HOME']
|
home = os.environ['HOME']
|
||||||
@@ -933,6 +935,10 @@ if f:
|
|||||||
nsupdate_bin = a
|
nsupdate_bin = a
|
||||||
elif o == 'pushsrv':
|
elif o == 'pushsrv':
|
||||||
pushsrv = a
|
pushsrv = a
|
||||||
|
elif o == 'dyndomain':
|
||||||
|
dyndomain = a
|
||||||
|
elif o == 'dynfqdn':
|
||||||
|
dynfqdn = a
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
if len(args) != 0:
|
if len(args) != 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user