#!/bin/sh # Whether a reboot is required on DNF-based systems command -v needs-restarting > /dev/null 2>&1 || { echo "needs-restarting not found" >&2; exit 1; } if needs-restarting -r > /dev/null 2>&1; then echo 'No' else status=$? if [ "$status" -eq 1 ]; then echo 'Yes' else exit "$status" fi fi