From e5f97cc751936406700825c42e2e0b93561ca3b5 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Thu, 22 Sep 2016 11:01:39 +0300 Subject: Cleanup --- README.md | 2 +- functions.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 80221ae..05eee34 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ### System Requirements -- OS X +- OS X (tested with 10.11) ### system_profiler diff --git a/functions.py b/functions.py index a7002ce..9fa4b4e 100644 --- a/functions.py +++ b/functions.py @@ -21,10 +21,10 @@ def rsync(src, dst, flags='auE'): def dscl(domain='.', *args): - subprocess.call(['/usr/bin/dscl', domain, ]) + subprocess.call(['/usr/bin/dscl', domain] + args) -def exec_jar(path, user='jkmmadmin'): +def exec_jar(path, user): javapath = '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java' if not os.path.exists(javapath): raise ValueError('Looks like your machine does not have Java installed') @@ -156,7 +156,7 @@ def install_profile(path): """ Installs a configuration profile """ - subprocess.call(['profiles', '-I', '-F', path]) + subprocess.call(['/usr/bin/profiles', '-I', '-F', path]) def install_pkg(pkg, target='/'): @@ -169,7 +169,7 @@ def install_pkg(pkg, target='/'): def mount_afp(username, password, url, mountpoint=None): if mountpoint is None: mountpoint = tempfile.mkdtemp() - subprocess.call(['mount_afp', 'afp://%s:%s@%s' % (username, password, url), mountpoint]) + subprocess.call(['/sbin/mount_afp', 'afp://%s:%s@%s' % (username, password, url), mountpoint]) return mountpoint @@ -196,15 +196,15 @@ def install_su(restart=True): """ Install all Apple software Updates, restart if update requires it """ - su_results = subprocess.check_output(['softwareupdate', '-ia']) + su_results = subprocess.check_output(['/usr/sbin/softwareupdate', '-ia']) if restart and 'restart' in su_results: tell_app('Finder', 'restart') sys.exit(0) def disable_wifi(port='en1'): - subprocess.call(['networksetup', '-setairportpower', port, 'off']) - subprocess.call(['networksetup', '-setnetworkserviceenabled', 'Wi-Fi', 'off']) + subprocess.call(['/usr/sbin/networksetup', '-setairportpower', port, 'off']) + subprocess.call(['/usr/sbin/networksetup', '-setnetworkserviceenabled', 'Wi-Fi', 'off']) def log(msg): -- cgit v1.2.3