Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # requires root
- import subprocess
- import shlex
- command_line = "ping -c 3 www.altsci.com"
- args = shlex.split(command_line)
- try:
- subprocess.check_call(args,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- print "Alt Sci is up!"
- except subprocess.CalledProcessError:
- print "Failed to get ping"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement