mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 21:47:20 +00:00
This adds two things: - when implementing the CLI, I found [a panel](https://www.figma.com/file/oQl2oQUG0iRkUy0YOxc307/%2314921-Deploy-security-agents-to-macOS%2C-Windows%2C-and-Linux-hosts?type=design&node-id=779-29335&mode=design&t=Y27cbj7DdhUEGJko-4) in the Figma file with validations that I missed - explicit shebang for bash scrips (requested by product) and removed a comment that will be user facing for exe files.
10 lines
430 B
Bash
10 lines
430 B
Bash
#!/bin/sh
|
|
|
|
# grab the identifier from the first PackageInfo we find. Those are placed in different locations depending on the installer
|
|
pkg_id=$(tar xOvf "$INSTALLER_PATH" --include='*PackageInfo*' 2>/dev/null | sed -n 's/.*identifier="\([^"]*\)".*/\1/p')
|
|
|
|
# remove all the files and empty directories that were installed
|
|
pkgutil --files $pkg_id | tr '\n' '\0' | xargs -n 1 -0 rm -d
|
|
|
|
# remove the receipt
|
|
pkgutil --forget $pkg_id
|