#!/bin/bash

PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin

if which uspepc >/dev/null 2>&1; then
    USPEPC=uspepc
else
    USPEPC=/bin/false
fi

if which cgutlcmd >/dev/null 2>&1; then
    CGUTLCMD=cgutlcmd
else
    CGUTLCMD=/bin/false
fi

killall wdhole 2>/dev/null

# HP
if dmidecode | grep -q "Vendor: HP"; then
    wdstop.hp
fi

if lsmod | grep -q 'hpwdt\|iTCO_wdt';then
    which wdstop.hp >/dev/null 2>&1 && wdstop.hp
    exit
fi

# MSC
if ${USPEPC} -INFO -b 2>/dev/null| head -1 | grep -q "HW platform:.*Q7-US15W";then
    wdstop.msc
    exit
fi

# Congatec    
if ${CGUTLCMD} cginfo /ot:board /dump /cgos 2>/dev/null >/dev/null ;then
    wdstop.cgt
    exit
fi


