Skip to content

Instantly share code, notes, and snippets.

@zoltrain
Created April 8, 2015 16:41
Show Gist options
  • Save zoltrain/0585f7e1e3ca7b5f5e2a to your computer and use it in GitHub Desktop.
Save zoltrain/0585f7e1e3ca7b5f5e2a to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
case "$1" in
configure)
# logic common to all installs/upgrades
# if $2 is set, this is an upgrade
if ( [ -n "$2" ] && [ "$RESTART_ON_UPGRADE" = "true" ] ) ; then
# restart a service
fi
;;
triggered)
# logic when this script is triggered by another package install
# maybe a binary has changed?
if ( [ -n "$2" ] == “redis-binary-upgrade”) ; then
# restart a service
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
# handle package installation failure
;;
*)
echo "$APP_NAME $0 called with unknown argument '$1'" >&2
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment