Skip to content

Instantly share code, notes, and snippets.

@sdsykes
Last active September 11, 2018 03:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdsykes/0df8617285b03508e9150448c73a5427 to your computer and use it in GitHub Desktop.
Save sdsykes/0df8617285b03508e9150448c73a5427 to your computer and use it in GitHub Desktop.
Diagnostic script for TotalSpaces2

This is a simple shell script which will hopefully diagnose your situation.

  1. open /Applications/Utilities/Terminal.app
  2. execute:
curl -sL https://gist.github.com/sdsykes/0df8617285b03508e9150448c73a5427/raw/tsdiag | bash
  1. Find the output file on your Desktop and email it back to me (support@binaryage.com). Please don't post the file on our forums.
#!/usr/bin/env bash
umask 0077
cd ~/Desktop
tsdiagname=tsdiag.$$
tsdiagd=~/Desktop/$tsdiagname
mkdir -p "$tsdiagd"
set -e -o pipefail
LIBRARY_OSAX=/Library/ScriptingAdditions/TotalSpaces.osax
SYSTEM_OSAX=/System/Library/ScriptingAdditions/TotalSpaces.osax
TS_APP=/Applications/TotalSpaces2.app
FS_BUNDLE=/Applications/TotalSpaces2.app/Contents/Resources/TotalSpaces.bundle
# - helpers -------------------------------------------------------------------------------------------------------------
read_osax_info_key() {
local info_plist_path="$1/Contents/Info"
set +e
defaults read "$info_plist_path" "$2" 2> /dev/null
set -e
}
check_bundle() {
local osax_path="$1"
if [[ ! -d "$osax_path" ]]; then
echo "$osax_path not present" >>"${tsdiagd}/check_bundle.txt"
else
BUNDLE_IDENTIFIER=$(read_osax_info_key ${osax_path} CFBundleIdentifier)
BUNDLE_VERSION=$(read_osax_info_key ${osax_path} CFBundleVersion)
echo "$osax_path $BUNDLE_IDENTIFIER $BUNDLE_VERSION" >>"${tsdiagd}/check_bundle.txt"
fi
}
# - entry point ---------------------------------------------------------------------------------------------------------
echo "This program will gather diagnostic information about your system, and store it on your desktop ready for sending to BinaryAge. We do not collect any personal data, and the information is only used for diagnostic purposes."
# echo "Press ENTER to continue, or CTRL-C to quit."
# read enter
echo Working...
echo "Date: " `(LANG=C;date '+%Y/%m/%d(%a) %H:%M:%S %z(%Z)') 2>&1` >>"${tsdiagd}/vers.txt"
sw_vers >>"${tsdiagd}/vers.txt"
echo ...
set +e
csrutil status >>"${tsdiagd}/csrutil_status.txt"
set -e
echo ...
ls -l /System/Library/ScriptingAdditions >>"${tsdiagd}/ls_system_scripting.txt" 2>&1
ls -l /Library/ScriptingAdditions >>"${tsdiagd}/ls_library_scripting.txt" 2>&1
set +e
ls -l ~/Library/ScriptingAdditions >>"${tsdiagd}/ls_user_scripting.txt" 2>&1
set -e
echo ...
check_bundle "$LIBRARY_OSAX"
check_bundle "$SYSTEM_OSAX"
check_bundle "$TS_APP"
check_bundle "$FS_BUNDLE"
tsprefs=~/Library/Preferences/com.binaryage.TotalSpaces2.plist
[ -f "$tsprefs" ] && cp "$tsprefs" "$tsdiagd"
cp -R ~/Library/Logs/DiagnosticReports "$tsdiagd"
cp -R /Library/Logs/DiagnosticReports "${tsdiagd}/SystemReports"
df -hl >>${tsdiagd}/df.txt 2>&1
ps auxww >${tsdiagd}/ps.txt 2>&1
top -l1 > ${tsdiagd}/top.txt 2>&1
last > ${tsdiagd}/last.txt 2>&1
echo ...
tail -2000 /var/log/system.log >"${tsdiagd}/system.log" 2>&1
## 5 days back
log show --last 5d --predicate 'processImagePath contains "TotalSpaces" or processImagePath contains "Dock" or processImagePath beginswith "/Applications/TotalSpaces" or processImagePath beginswith "/System/Library/CoreServices/Dock.app"' 2>&1 | bzip2 >${tsdiagd}/asl.log.bz2
tarfile=tsdiag.$$.tar
tar -cf "$tarfile" $tsdiagname
gzip -9 "$tarfile"
/bin/rm -rf "$tsdiagd"
echo Diagnostics are in tsdiag.$$.tar.gz on your desktop. Please send the file to support@binaryage.com
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment