Created
September 16, 2017 23:17
-
-
Save dbuentello/8addde1dfc835165f2728a7362be0843 to your computer and use it in GitHub Desktop.
Uninstall nmap from osx installed via dmg
This file contains hidden or 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
#!/bin/sh | |
receipts() { | |
find /private/var/db/receipts -iregex '.*/org\.insecure\.nmap.*' | |
} | |
bom_files() { | |
receipts | grep '\.bom$' | |
} | |
boms_list_files_installed() { | |
bom_files | while read -r BOM; do | |
lsbom -s "$BOM" | |
done | sed 's/^\.//g;s%/Zenmap.app%/Applications&%g;/^$/d' | |
} | |
{ receipts ; boms_list_files_installed ;} | while read -r FILENAME; do | |
if [ -f "$FILENAME" ]; then | |
echo "$FILENAME" | |
fi | |
done | sudo xargs -L1 rm -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment