From 87553a5b3b292c518fb6311b04ea8c5035c8ef08 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Thu, 23 Jan 2014 12:38:08 -0500 Subject: [PATCH] add dev script list_loaded_kext_ids For the benefit of Cask authors writing uninstall stanzas --- developer/bin/list_loaded_kext_ids | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 developer/bin/list_loaded_kext_ids diff --git a/developer/bin/list_loaded_kext_ids b/developer/bin/list_loaded_kext_ids new file mode 100755 index 0000000000..03a0041509 --- /dev/null +++ b/developer/bin/list_loaded_kext_ids @@ -0,0 +1,32 @@ +#!/bin/bash +# +# list_loaded_kext_ids +# + +set -e; # exit on any uncaught error +set +o histexpand; # don't expand history expressions +shopt -s nocasematch; # case-insensitive regular expressions + +_list_loaded_kext_ids () { + /usr/sbin/kextstat -kl | /usr/bin/cut -c53- | /usr/bin/cut -f1 -d' ' | /usr/bin/egrep -v '^com\.apple\.' +} + +if [[ $1 =~ ^-+h(elp)?$ ]]; then + printf "list_loaded_kext_ids + +Print Bundle IDs for currently loaded Kernel Extensions (kexts) +which may be useful in a Cask uninstall stanza, eg + + uninstall :kext => 'kext.bundle.id.goes.here' + +Kexts attributed to Apple are excluded from the output. + +See CONTRIBUTING.md for more information. + +" + exit +fi + +_list_loaded_kext_ids "$@"; + +#