Skip to content

Commit a880358

Browse files
committed
Add SentinelOne.munki recipe
1 parent e4f7703 commit a880358

File tree

1 file changed

+152
-0
lines changed

1 file changed

+152
-0
lines changed
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>Description</key>
6+
<string>Downloads a release of SentinelOne and imports it into Munki.</string>
7+
<key>Identifier</key>
8+
<string>com.github.n8felton.munki.SentinelOne</string>
9+
<key>Input</key>
10+
<dict>
11+
<key>MUNKI_CATEGORY</key>
12+
<string>Utilities</string>
13+
<key>MUNKI_REPO_SUBDIR</key>
14+
<string>apps/%NAME%</string>
15+
<key>NAME</key>
16+
<string>SentinelOne</string>
17+
<key>pkginfo</key>
18+
<dict>
19+
<key>catalogs</key>
20+
<array>
21+
<string>testing</string>
22+
</array>
23+
<key>category</key>
24+
<string>%MUNKI_CATEGORY%</string>
25+
<key>description</key>
26+
<string>A cybersecurity platform that uses AI to protect networks, devices, and identities from threats. It can detect, remove, and prevent malware and other security risks.</string>
27+
<key>developer</key>
28+
<string>SentinelOne, Inc.</string>
29+
<key>display_name</key>
30+
<string>SentinelOne</string>
31+
<key>name</key>
32+
<string>%NAME%</string>
33+
</dict>
34+
</dict>
35+
<key>MinimumVersion</key>
36+
<string>0.6.1</string>
37+
<key>ParentRecipe</key>
38+
<string>com.github.n8felton.download.SentinelOne</string>
39+
<key>Process</key>
40+
<array>
41+
<dict>
42+
<key>Arguments</key>
43+
<dict>
44+
<key>pkgdirs</key>
45+
<dict/>
46+
<key>pkgroot</key>
47+
<string>%RECIPE_CACHE_DIR%/dmgroot</string>
48+
</dict>
49+
<key>Processor</key>
50+
<string>PkgRootCreator</string>
51+
</dict>
52+
<dict>
53+
<key>Arguments</key>
54+
<dict>
55+
<key>destination_path</key>
56+
<string>%pkgroot%/%NAME%.pkg</string>
57+
<key>source_path</key>
58+
<string>%pathname%</string>
59+
</dict>
60+
<key>Processor</key>
61+
<string>Copier</string>
62+
</dict>
63+
<dict>
64+
<key>Arguments</key>
65+
<dict>
66+
<key>dmg_path</key>
67+
<string>%RECIPE_CACHE_DIR%/%NAME%-%version%.dmg</string>
68+
<key>dmg_root</key>
69+
<string>%pkgroot%</string>
70+
</dict>
71+
<key>Processor</key>
72+
<string>DmgCreator</string>
73+
</dict>
74+
<dict>
75+
<key>Arguments</key>
76+
<dict>
77+
<key>path_list</key>
78+
<array>
79+
<string>%RECIPE_CACHE_DIR%/dmgroot</string>
80+
</array>
81+
</dict>
82+
<key>Processor</key>
83+
<string>PathDeleter</string>
84+
</dict>
85+
<dict>
86+
<key>Arguments</key>
87+
<dict>
88+
<key>additional_pkginfo</key>
89+
<dict>
90+
<key>installcheck_script</key>
91+
<string>#!/bin/zsh
92+
# Exit codes
93+
PROCEED_WITH_INSTALL=0
94+
INSTALL_NOT_NEEDED=1
95+
96+
if [[ ! -e /usr/local/bin/sentinelctl ]]; then
97+
exit ${PROCEED_WITH_INSTALL}
98+
fi
99+
100+
SENTINEL_VERSION=$(/usr/local/bin/sentinelctl version | awk '{print $2}')
101+
102+
if [[ ${SENTINEL_VERSION} &lt; %version% ]]; then
103+
exit ${PROCEED_WITH_INSTALL}
104+
fi
105+
106+
exit ${INSTALL_NOT_NEEDED}
107+
</string>
108+
<key>postinstall_script</key>
109+
<string>#!/bin/sh
110+
INSTALL_PKG="/tmp/%NAME%.pkg"
111+
112+
if [[ -e /usr/local/bin/sentinelctl ]]; then
113+
echo "sentinelctl found. Upgrading..."
114+
/usr/local/bin/sentinelctl upgrade-pkg "${INSTALL_PKG}"
115+
RETURN_CODE=$?
116+
else
117+
echo "sentinelctl not found. Installing..."
118+
installer -pkg "${INSTALL_PKG}" -target /
119+
RETURN_CODE=$?
120+
fi
121+
122+
rm -f "${INSTALL_PKG}"
123+
exit ${RETURN_CODE}
124+
</string>
125+
<key>uninstallable</key>
126+
<false/>
127+
</dict>
128+
</dict>
129+
<key>Processor</key>
130+
<string>MunkiPkginfoMerger</string>
131+
</dict>
132+
<dict>
133+
<key>Arguments</key>
134+
<dict>
135+
<key>additional_makepkginfo_options</key>
136+
<array>
137+
<string>--item=%NAME%.pkg</string>
138+
<string>--destinationpath=/tmp</string>
139+
<string>--unattended_install</string>
140+
<string>--pkgvers=%version%</string>
141+
</array>
142+
<key>pkg_path</key>
143+
<string>%dmg_path%</string>
144+
<key>repo_subdirectory</key>
145+
<string>%MUNKI_REPO_SUBDIR%</string>
146+
</dict>
147+
<key>Processor</key>
148+
<string>MunkiImporter</string>
149+
</dict>
150+
</array>
151+
</dict>
152+
</plist>

0 commit comments

Comments
 (0)