You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

is-reboot-required.sh 281B

1234567891011121314
  1. #!/bin/bash
  2. set -euo pipefail
  3. IFS=$'\n\t'
  4. RUNNING_VERSION=$(uname -r)
  5. FS_VERSION=$(file /boot/vmlinuz-linux | sed -rn 's/.* version ([0-9\.A-Z-]+) .*/\1/pi')
  6. if [ ! "${RUNNING_VERSION}" = ${FS_VERSION} ]; then
  7. echo "Reboot required."
  8. else
  9. echo "No reboot required."
  10. fi