1
0
Fork 0

Only rely on ping-check, reduce wait time for down vpn

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-06-02 11:03:55 +02:00
parent fc30629496
commit 6b9a58aa25
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -8,7 +8,7 @@ import yaml
def check_ping_reachable(ip):
try:
subprocess.check_call(['ping', '-c2', ip],
subprocess.check_call(['ping', '-c2', '-W1', ip],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL)
return True
@ -31,7 +31,7 @@ def main():
results = [config['prefix']]
for check in config['checks']:
if check_service_active(check['service']) and check_ping_reachable(check['ip']):
if check_ping_reachable(check['ip']):
check['color'] = config['colors']['success']
else:
check['color'] = config['colors']['failure']