to keep up with jakob
This commit is contained in:
@@ -192,6 +192,7 @@ def importConfigs (db):
|
||||
REPORT_DASHBOARD_URL = ccd('REPORT_DASHBOARD_URL', 'http://pi.alert/' , c_d, 'PiAlert URL', 'text', '', 'General')
|
||||
DIG_GET_IP_ARG = ccd('DIG_GET_IP_ARG', '-4 myip.opendns.com @resolver1.opendns.com' , c_d, 'DIG arguments', 'text', '', 'General')
|
||||
UI_LANG = ccd('UI_LANG', 'English' , c_d, 'Language Interface', 'selecttext', "['English', 'German', 'Spanish']", 'General')
|
||||
UI_PRESENCE = ccd('UI_PRESENCE', ['online', 'offline', 'archived'] , c_d, 'Include in presence', 'multiselect', "['online', 'offline', 'archived']", 'General')
|
||||
|
||||
# Email
|
||||
REPORT_MAIL = ccd('REPORT_MAIL', False , c_d, 'Enable email', 'boolean', '', 'Email', ['test'])
|
||||
@@ -597,9 +598,8 @@ def check_internet_IP ():
|
||||
dns_IP = get_dynamic_DNS_IP()
|
||||
|
||||
# Check Dynamic DNS IP
|
||||
if dns_IP == "" :
|
||||
mylog('info', [' Error retrieving Dynamic DNS IP'])
|
||||
mylog('info', [' Exiting...'])
|
||||
if dns_IP == "" or dns_IP == "0.0.0.0" :
|
||||
mylog('info', [' Error retrieving Dynamic DNS IP'])
|
||||
mylog('info', [' ', dns_IP])
|
||||
|
||||
# Check DNS Change
|
||||
@@ -627,6 +627,11 @@ def get_internet_IP ():
|
||||
|
||||
# Check result is an IP
|
||||
IP = check_IP_format (cmd_output)
|
||||
|
||||
# Handle invalid response
|
||||
if IP == '':
|
||||
IP = '0.0.0.0'
|
||||
|
||||
return IP
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -647,6 +652,11 @@ def get_dynamic_DNS_IP ():
|
||||
|
||||
# Check result is an IP
|
||||
IP = check_IP_format (dig_output)
|
||||
|
||||
# Handle invalid response
|
||||
if IP == '':
|
||||
IP = '0.0.0.0'
|
||||
|
||||
return IP
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -2367,7 +2377,7 @@ class noti_struc:
|
||||
def check_config(service):
|
||||
|
||||
if service == 'email':
|
||||
if SMTP_PASS == '' or SMTP_SERVER == '' or SMTP_USER == '' or REPORT_FROM == '' or REPORT_TO == '':
|
||||
if SMTP_SERVER == '' or REPORT_FROM == '' or REPORT_TO == '':
|
||||
mylog('none', [' Error: Email service not set up correctly. Check your pialert.conf SMTP_*, REPORT_FROM and REPORT_TO variables.'])
|
||||
return False
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user