1
0
mirror of https://github.com/smallstep/cli.git synced 2026-10-24 11:19:19 +03:00
Files
step-ca-cli/scripts/postremove.sh
Eli Young 219dbe6d12 Use alternatives system for RPMs
This unifies the package scriptlets. Additionally, it changes the
preremove scriptlet to a postremove script, as that's the more typical
place to remove alternatives entries.
2021-12-26 18:27:33 -08:00

35 lines
425 B
Bash

#!/bin/sh
removeAlternatives() {
update-alternatives --remove step /usr/bin/step-cli
}
upgrade() {
:
}
remove() {
removeAlternatives
}
action="$1"
if [ "$1" = "remove" ]; then
action="remove"
elif [ "$1" = "upgrade" ] && [ -n "$2" ]; then
action="upgrade"
elif [ "$1" = "disappear" ]; then
action="remove"
fi
case "$action" in
"0" | "remove")
remove
;;
"1" | "upgrade")
upgrade
;;
*)
remove
;;
esac