You've already forked step-ca-cli
mirror of
https://github.com/smallstep/cli.git
synced 2026-10-24 11:19:19 +03:00
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.
35 lines
425 B
Bash
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
|