+SBSign=`which sbsign 2> /dev/null`
+KeysDir=/mnt/refind
+
+KeysInfo=`df $KeysDir 2> /dev/null | grep $KeysDir`
+
+if [[ ! -n $SBSign && $SignIt == 1 ]] ; then
+ echo "Can't find sbsign binary! Aborting!"
+ exit 1
+fi
+
+if [[ ! -n $KeysInfo && $SignIt == 1 ]] ; then
+ mount /mnt/refind
+ if [[ $? -ne 0 ]] ; then
+ echo "Error mounting $KeysDir! Aborting!"
+ echo ""
+ exit 1
+ fi
+fi
+
+# From here on, if there's an error, abort immediately.
+set -e