mirror of
https://github.com/mtan93/Installomator.git
synced 2026-04-01 14:23:06 +01:00
MDM with caffeinate
This commit is contained in:
@@ -4,13 +4,21 @@
|
||||
|
||||
what="valuesfromarguments" # enter the software to install
|
||||
|
||||
# No sleeping
|
||||
/usr/bin/caffeinate -d -i -m -u &
|
||||
caffeinatepid=$!
|
||||
caffexit () {
|
||||
kill "$caffeinatepid"
|
||||
exit $1
|
||||
}
|
||||
|
||||
# Verify that Installomator has been installed
|
||||
destFile="/usr/local/Installomator/Installomator.sh"
|
||||
if [ ! -e "${destFile}" ]; then
|
||||
echo "Installomator not found here:"
|
||||
echo "${destFile}"
|
||||
echo "Exiting."
|
||||
exit 99
|
||||
caffexit 99
|
||||
fi
|
||||
|
||||
${destFile} valuesfromarguments \
|
||||
@@ -26,9 +34,8 @@ ${destFile} valuesfromarguments \
|
||||
if [ $? != 0 ]; then
|
||||
# This is currently not working in Mosyle, that will ignore script errors. Please request support for this from Mosyle!
|
||||
echo "Error installing ${what}. Exit code $?"
|
||||
exit $?
|
||||
caffexit $?
|
||||
fi
|
||||
|
||||
echo "[$(DATE)][LOG-END]"
|
||||
|
||||
exit 0
|
||||
caffexit 0
|
||||
|
||||
Reference in New Issue
Block a user