Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import subprocess,time,pynotify
- while True:
- a=subprocess.Popen(['ping','-c','1','192.168.1.254'],stdout=subprocess.PIPE).communicate()[0].splitlines()
- if len(a)==0 or a[-1]=='':
- n=pynotify.Notification('ping','failed')
- n.set_timeout(2000)
- n.show()
- time.sleep(40)
- else:
- time.sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement