add DSTVOLUME environmental variable

This commit is contained in:
Erik Gomez
2017-01-11 09:49:48 -08:00
parent 0bc9ecc462
commit 1120098377

View File

@@ -15,7 +15,12 @@ def getconsoleuser():
def launchctld(identifier):
path = os.path.join('/Library/LaunchDaemons/', identifier + '.plist')
launchd = identifier + '.plist'
try:
volume = os.environ['DSTVOLUME']
path = os.path.join(volume, 'Library', 'LaunchDaemons', launchd)
except KeyError:
path = os.path.join('/Library', 'LaunchDaemons', launchd)
try:
cmd = ['/bin/launchctl', 'load', path]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,