Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmachos committed Oct 10, 2024
1 parent 2bff514 commit 5c9402c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions dump-target-domains
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 "$@"

0 comments on commit 5c9402c

Please sign in to comment.