diff options
author | Filipp Lepalaan <f@0x00.co> | 2012-12-28 13:44:12 +0200 |
---|---|---|
committer | Filipp Lepalaan <f@0x00.co> | 2012-12-28 13:44:12 +0200 |
commit | b5e50f8a4c798a444c7b619e37f8f564f3f768d4 (patch) | |
tree | 12bae4debdb4c02ce81bb6dbf98e5e6bec34202e /simpleton.py | |
parent | dc0ca4dd8d03b04f2c97e6761e4fee7722c455ff (diff) | |
download | simpleton-b5e50f8a4c798a444c7b619e37f8f564f3f768d4.tar.gz simpleton-b5e50f8a4c798a444c7b619e37f8f564f3f768d4.tar.bz2 simpleton-b5e50f8a4c798a444c7b619e37f8f564f3f768d4.zip |
Added AFP mount test
Diffstat (limited to 'simpleton.py')
-rwxr-xr-x | simpleton.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/simpleton.py b/simpleton.py index b7dab89..a025749 100755 --- a/simpleton.py +++ b/simpleton.py @@ -6,8 +6,15 @@ # To Public License, Version 2, as published by Sam Hocevar. See # http://sam.zoy.org/wtfpl/COPYING for more details. -import time, os, sys -import urllib, ftplib, smtplib, yaml +import time +import os +import sys +import urllib +import ftplib +import smtplib +import yaml +import subprocess +import tempfile from termcolor import colored, cprint if len(sys.argv) < 2 or not os.path.exists(sys.argv[1]): @@ -28,8 +35,15 @@ for k, v in services.items(): ftplib.FTP(u) if k == 'SMTP': smtplib.SMTP(u) + if k == 'AFP': + tmp_path = tempfile.mkdtemp() + subprocess.check_call(['/sbin/mount_afp', '-o', 'nobrowse', u, tmp_path]) + subprocess.check_call(['/sbin/umount', tmp_path]) + os.rmdir(tmp_path) + passed += 1 except Exception, e: + print e out = colored(msg, 'red') print out |