mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-08 05:31:53 +00:00
Merge branch 'Logging-level-improvements' of https://github.com/Installomator/Installomator into Logging-level-improvements
This commit is contained in:
@@ -99,7 +99,7 @@ printlog(){
|
|||||||
curl -s -X POST https://http-intake.logs.datadoghq.com/v1/input -H "Content-Type: text/plain" -H "DD-API-KEY: $datadogAPI" -d "${log_priority} : $mdmURL : Installomator-${label} : ${VERSIONDATE//-/} : $SESSION : ${logmessage}" > /dev/null
|
curl -s -X POST https://http-intake.logs.datadoghq.com/v1/input -H "Content-Type: text/plain" -H "DD-API-KEY: $datadogAPI" -d "${log_priority} : $mdmURL : Installomator-${label} : ${VERSIONDATE//-/} : $SESSION : ${logmessage}" > /dev/null
|
||||||
done <<< "$log_message"
|
done <<< "$log_message"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Extra spaces
|
# Extra spaces
|
||||||
space_char=""
|
space_char=""
|
||||||
if [[ ${#log_priority} -eq 3 ]]; then
|
if [[ ${#log_priority} -eq 3 ]]; then
|
||||||
@@ -491,7 +491,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
|||||||
printlog "Changing owner to $currentUser"
|
printlog "Changing owner to $currentUser"
|
||||||
chown -R "$currentUser" "$targetDir/$appName"
|
chown -R "$currentUser" "$targetDir/$appName"
|
||||||
else
|
else
|
||||||
printlog "No user logged in or SYSTEMOWNER=1, setting owner to root:wheel"
|
printlog "No user logged in or SYSTEMOWNER=1, setting owner to root:wheel"
|
||||||
chown -R root:wheel "$targetDir/$appName"
|
chown -R root:wheel "$targetDir/$appName"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -521,7 +521,7 @@ mountDMG() {
|
|||||||
dmgmountStatus=$(echo $?)
|
dmgmountStatus=$(echo $?)
|
||||||
dmgmount=$(echo $dmgmountOut | tail -n 1 | cut -c 54- )
|
dmgmount=$(echo $dmgmountOut | tail -n 1 | cut -c 54- )
|
||||||
deduplicatelogs "$dmgmountOut"
|
deduplicatelogs "$dmgmountOut"
|
||||||
|
|
||||||
if [[ $dmgmountStatus -ne 0 ]] ; then
|
if [[ $dmgmountStatus -ne 0 ]] ; then
|
||||||
#if ! dmgmount=$(echo 'Y'$'\n' | hdiutil attach "$tmpDir/$archiveName" -nobrowse -readonly | tail -n 1 | cut -c 54- ); then
|
#if ! dmgmount=$(echo 'Y'$'\n' | hdiutil attach "$tmpDir/$archiveName" -nobrowse -readonly | tail -n 1 | cut -c 54- ); then
|
||||||
cleanupAndExit 3 "Error mounting $tmpDir/$archiveName error:\n$logoutput" ERROR
|
cleanupAndExit 3 "Error mounting $tmpDir/$archiveName error:\n$logoutput" ERROR
|
||||||
@@ -530,7 +530,7 @@ mountDMG() {
|
|||||||
cleanupAndExit 3 "Error accessing mountpoint for $tmpDir/$archiveName error:\n$logoutput" ERROR
|
cleanupAndExit 3 "Error accessing mountpoint for $tmpDir/$archiveName error:\n$logoutput" ERROR
|
||||||
fi
|
fi
|
||||||
printlog "Debugging enabled, dmgmount output was:\n$logoutput" DEBUG
|
printlog "Debugging enabled, dmgmount output was:\n$logoutput" DEBUG
|
||||||
|
|
||||||
printlog "Mounted: $dmgmount" INFO
|
printlog "Mounted: $dmgmount" INFO
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -547,7 +547,7 @@ installFromPKG() {
|
|||||||
spctlOut=$(spctl -a -vv -t install "$archiveName" 2>&1 )
|
spctlOut=$(spctl -a -vv -t install "$archiveName" 2>&1 )
|
||||||
spctlStatus=$(echo $?)
|
spctlStatus=$(echo $?)
|
||||||
printlog "spctlOut is $spctlOut" DEBUG
|
printlog "spctlOut is $spctlOut" DEBUG
|
||||||
|
|
||||||
teamID=$(echo $spctlOut | awk -F '(' '/origin=/ {print $2 }' | tr -d '()' )
|
teamID=$(echo $spctlOut | awk -F '(' '/origin=/ {print $2 }' | tr -d '()' )
|
||||||
# Apple signed software has no teamID, grab entire origin instead
|
# Apple signed software has no teamID, grab entire origin instead
|
||||||
if [[ -z $teamID ]]; then
|
if [[ -z $teamID ]]; then
|
||||||
@@ -555,7 +555,7 @@ installFromPKG() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
deduplicatelogs "$spctlOut"
|
deduplicatelogs "$spctlOut"
|
||||||
|
|
||||||
if [[ $spctlStatus -ne 0 ]] ; then
|
if [[ $spctlStatus -ne 0 ]] ; then
|
||||||
#if ! spctlout=$(spctl -a -vv -t install "$archiveName" 2>&1 ); then
|
#if ! spctlout=$(spctl -a -vv -t install "$archiveName" 2>&1 ); then
|
||||||
cleanupAndExit 4 "Error verifying $archiveName error:\n$logoutput" ERROR
|
cleanupAndExit 4 "Error verifying $archiveName error:\n$logoutput" ERROR
|
||||||
@@ -671,7 +671,7 @@ installPkgInDmg() {
|
|||||||
archiveName="${filearray[1]}"
|
archiveName="${filearray[1]}"
|
||||||
else
|
else
|
||||||
if [[ -s "$dmgmount/$pkgName" ]] ; then # was: $tmpDir
|
if [[ -s "$dmgmount/$pkgName" ]] ; then # was: $tmpDir
|
||||||
archiveName="$tmpDir/$pkgName"
|
archiveName="$dmgmount/$pkgName"
|
||||||
else
|
else
|
||||||
# try searching for pkg
|
# try searching for pkg
|
||||||
findfiles=$(find "$dmgmount" -iname "$pkgName") # was: $tmpDir
|
findfiles=$(find "$dmgmount" -iname "$pkgName") # was: $tmpDir
|
||||||
@@ -685,7 +685,7 @@ installPkgInDmg() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
printlog "found pkg: $archiveName"
|
printlog "found pkg: $archiveName"
|
||||||
|
|
||||||
# installFromPkgs
|
# installFromPkgs
|
||||||
installFromPKG
|
installFromPKG
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user