Skip to content

Commit e759d26

Browse files
authored
Merge pull request #43 from salopensource/feature_salv4_support
Feature salv4 support
2 parents 3d131e9 + 157417a commit e759d26

28 files changed

+861
-6451
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
USE_PKGBUILD=1
22
include /usr/local/share/luggage/luggage.make
3-
PACKAGE_VERSION:=$(shell sed -n -e '/^VERSION/p' payload/usr/local/sal/bin/sal-submit | cut -d "'" -f 2)
3+
PACKAGE_VERSION:=$(shell sed -n -e '/^VERSION/p' payload/usr/local/sal/utils.py | cut -d "'" -f 2)
44
TITLE=sal_scripts
55
PACKAGE_NAME=sal_scripts
66
REVERSE_DOMAIN=com.github.salopensource

payload/usr/local/munki/postflight.d/sal-postflight

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/python
22

3+
34
import os
45
import subprocess
56
import sys
@@ -10,6 +11,7 @@ sys.path[:0] = ['/usr/local/munki', '/usr/local/sal']
1011
import utils
1112
from munkilib import FoundationPlist, munkicommon
1213

14+
1315
TOUCH_FILE_PATH = '/Users/Shared/.com.salopensource.sal.run'
1416
LAUNCHD = 'com.salopensource.sal.runner'
1517
LAUNCHD_PATH = '/Library/LaunchDaemons/{}.plist'.format(LAUNCHD)
@@ -77,6 +79,7 @@ def write_touch_file():
7779
with open(TOUCH_FILE_PATH, 'a'):
7880
os.utime(TOUCH_FILE_PATH, None)
7981

82+
8083
def ensure_launchd_loaded():
8184
cmd =[
8285
'/bin/launchctl',
@@ -92,6 +95,7 @@ def ensure_launchd_loaded():
9295
]
9396
subprocess.check_call(cmd)
9497

98+
9599
def main():
96100
check_server_online()
97101
write_touch_file()
@@ -100,5 +104,6 @@ def main():
100104
if not os.path.exists(LAUNCHD_PATH):
101105
subprocess.check_call(SUBMIT_SCRIPT)
102106

107+
103108
if __name__ == '__main__':
104109
main()

payload/usr/local/sal/bin/randomizer

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/usr/bin/python
22

3+
34
import subprocess
45
import optparse
56
import os
67
import time
78
import random
89
import stat
910

11+
1012
def get_options():
1113
"""Return commandline options."""
1214
usage = "%prog [options]"
@@ -21,6 +23,7 @@ def get_options():
2123
opts, _ = option_parser.parse_args()
2224
return opts
2325

26+
2427
def random_delay(delay):
2528
if delay == 0:
2629
print 'No delay set'
@@ -29,6 +32,7 @@ def random_delay(delay):
2932
print "Delaying run by %s seconds" % randomized_delay
3033
time.sleep(randomized_delay)
3134

35+
3236
def execute_path(path):
3337
path_stat = os.stat(path)
3438
if not path_stat.st_mode & stat.S_IWOTH:
@@ -39,6 +43,7 @@ def execute_path(path):
3943
else:
4044
print "'{}' is not executable or has bad permissions".format(path)
4145

46+
4247
def main():
4348
opts = get_options()
4449
path = opts.path
@@ -49,5 +54,6 @@ def main():
4954

5055
execute_path(path)
5156

57+
5258
if __name__ == '__main__':
5359
main()

0 commit comments

Comments
 (0)