#!/bin/sh 
mode=$1
if [ -f /tmp/iceos.REBOOT ]; then
  if [ -f /var/local/iceos.REBOOTED ]; then
    echo "$mode config rebooted more than once. Config may not correct !!!!"
    sleep 3
  else
    echo "Rebooting to affect desired $mode config"
    sleep 1
    touch /var/local/iceos.REBOOTED
    /sbin/reboot -f
    sleep 20
    exit
  fi
fi
