Skip to content

Commit

Permalink
🐛 fix(linux_shared.go): add condition to handle Debian package removal
Browse files Browse the repository at this point in the history
📝 docs(linux_shared.go): add comments to clarify the difference between RPM and Debian uninstallation conditions
  • Loading branch information
edwardsb committed Oct 27, 2023
1 parent 4590f86 commit 916e2e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion orbit/pkg/packaging/linux_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,9 @@ pkill fleet-desktop || true
func writePostRemove(opt Options, path string) error {
if err := ioutil.WriteFile(path, []byte(`#!/bin/sh
if [ "$1" = 0 ]; then
# For RPM during uninstall, $1 is 0
# For Debian during remove, $1 is "remove"
if [ "$1" = 0 ] || [ "$1" = "remove" ]; then
rm -rf /var/lib/orbit /var/log/orbit /usr/local/bin/orbit /etc/default/orbit /usr/lib/systemd/system/orbit.service /opt/orbit
fi
`), constant.DefaultFileMode); err != nil {
Expand Down

0 comments on commit 916e2e5

Please sign in to comment.