-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
# macos-scripts/dump-target-domains | ||
|
||
# dump-target-domain | ||
# Dumps the target domain (e.g gui/501) of all non Apple services | ||
# This relies on the "hints" provided by launchctl e.g | ||
# $ launchctl print at.obdev.littlesnitchmini.helper | ||
# Unrecognized target specifier, did you mean | ||
# gui/501/at.obdev.littlesnitchmini.helperx | ||
|
||
IFS=$'\n\t' | ||
# Set Internal Field Separator to newlines and tabs | ||
# This makes bash consider newlines and tabs as separating words | ||
# See: http://redsymbol.net/articles/unofficial-bash-strict-mode/ | ||
|
||
|
||
function main { | ||
|
||
SERVICES=() | ||
|
||
while read -r service; do | ||
SERVICES+=("${service}"); | ||
done < <(launchctl list | grep -v 'com.apple' | tail -n +2 | awk '{print $3}') | ||
|
||
for service in "${SERVICES[@]}"; do | ||
launchctl blame "${service}" 2>&1 | grep 'did you mean' -A 1 | tail -n 1 | ||
done | ||
|
||
} | ||
|
||
main "$@" |