# arg 1: the new package version pre_install() { # # do pre-install stuff here # if lsmod | grep i2c >/dev/null; then for mod in `lsmod | grep i2c | awk '{print$1}'`; do rmmod $mod done fi /bin/true } # arg 1: the new package version post_install() { # # do post-install stuff here # /sbin/depmod -a /bin/true } # arg 1: the new package version # arg 2: the old package version pre_upgrade() { # # do pre-upgrade stuff here # if lsmod | grep i2c >/dev/null; then for mod in `lsmod | grep i2c | awk '{print$1}'`; do rmmod $mod done fi /bin/true } # arg 1: the new package version # arg 2: the old package version post_upgrade() { # # do post-upgrade stuff here # /sbin/depmod -a /bin/true } # arg 1: the old package version pre_remove() { # # do pre-remove stuff here # if lsmod | grep i2c >/dev/null; then for mod in `lsmod | grep i2c | awk '{print$1}'`; do rmmod $mod done fi /bin/true } # arg 1: the old package version post_remove() { # # do post-remove stuff here # /sbin/depmod -a /bin/true } op=$1 shift $op $*