mars/debian/mars-dkms.postinst

27 lines
752 B
Plaintext
Raw Normal View History

2020-11-19 01:03:22 +00:00
#!/bin/sh
set -e
#DEBHELPER#
case "$1" in
install)
;;
configure|reconfigure)
# Get the version of the current loaded module:
old_version="$(cat /sys/module/mars/version 2>/dev/null)" || exit 0
# Get the version of the latest available module:
new_version="$(modinfo -F version mars 2>/dev/null)" || exit 0
# See if the new one is actually newer:
dpkg --compare-versions "$old_version" lt "$new_version" || exit 0
# Trigger an update notification that recommends a reboot:
touch /run/reboot-required || true
grep -Fqsx mars-dkms /run/reboot-required.pkgs || \
echo mars-dkms >> /run/reboot-required.pkgs || true
;;
*)
;;
esac
exit 0