Files
Anthias/bin/wait.py
Viktor Petersson ff09a5c800 Fixing PEP8 errors.
2016-06-22 14:34:41 +01:00

19 lines
312 B
Python

import time
import sh
# wait for default route
def is_routing_up():
try:
sh.grep(sh.route(), 'default')
return True
except sh.ErrorReturnCode_1:
return False
for _ in range(1, 30):
if is_routing_up():
break
print('Waiting for to come up...')
time.sleep(1)