#!/bin/bas
FILE=/var/run/reboot-required
if [ -f $FILE ]; then
   echo "Reboot is required' && reboot
else
   echo "File $FILE is not present, no need to reboot' >&2
fi