25 lines
383 B
Text
25 lines
383 B
Text
|
#!/usr/bin/env python3
|
||
|
|
||
|
import requests
|
||
|
from sys import argv
|
||
|
|
||
|
INTERFACE = argv[1]
|
||
|
LOCAL_IP = argv[4]
|
||
|
|
||
|
UPDATE_URL = '${url}'
|
||
|
USERNAME = '${username}'
|
||
|
PASSWORD = '${password}'
|
||
|
|
||
|
r = requests.get(
|
||
|
UPDATE_URL.format(
|
||
|
ip=LOCAL_IP,
|
||
|
),
|
||
|
auth=(
|
||
|
USERNAME,
|
||
|
PASSWORD,
|
||
|
)
|
||
|
)
|
||
|
|
||
|
with open('/var/tmp/dyndns.monitoring', 'w') as s:
|
||
|
s.write(str(r.status_code))
|