#!/bin/sh -e

if sinfo --list-reasons | fgrep slurm-update-idle; then
    cat << EOM

The nodes listed above are either awaiting cron updates or in the process of
updating, and may reboot at any time.

This may cause failures for any sysadmin tasks that require access to all
compute nodes.

If the head node is rebooted, updates may be left partially completed.

EOM
    printf "Are you sure you want to proceed? yes/[no] "
    read proceed
    if [ 0$proceed = 0yes ]; then
	exit 0
    else
	exit 1
    fi
fi
