#!/bin/sh
set -u  
if [ "${1:-}" = "-x" ] ; then set -xv; shift; fi 

if [ "`whoami`" != "root" ]; then
  echo `date` Only root can run $0
  exit 1
fi

here=`pwd`
cd /root

# stop the watchdog timer and ipmisrv process

### all lines that begin with 3 pound signs were commented
### out in order to remove any watchdog timer functionality.
### uncomment these lines to get the functionality back.
###echo `date` Stopping watchdog timer and ipmisrv
echo `date` Stopping ipmisrv  ### remove me for watchdog support
$IPMI_DIR/dogdisarm

ps axuww|grep ipmisrv| grep -v grep  

x=`ps axuww|grep ipmisrv| grep -v grep|awk '{print $2}'`
echo kill $x
kill $x
sleep 3



# Startup the watchdog timer and ipmisrv process.
# The timer will reset the system if 5 minutes passes
# without a reset by deadman with ipmisrv.

$IPMI_DIR/ipmi_startup

ps axuww|grep ipmisrv| grep -v grep  

cd $here
