#!/bin/sh
# Qcontrol boot script, disables watchdog

PREREQ=""
prereqs()
{
     echo "$PREREQ"
}

case $1 in
prereqs)
     prereqs
     exit 0
     ;;
esac

. /scripts/functions
# Begin real processing below this line

if qcommand -t; then
    # Only needed on TS-219P II and TS-419P II, safe to call on any TS-x19 though.
    device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
	     head -n1 | sed "s/^[^:]*: //")
    case $device in
	"QNAP TS-119/TS-219") break ;;
	"QNAP TS-41x")        break ;;
	*)                    exit 0 ;;
    esac

    /usr/sbin/qcommand watchdog off
fi

exit 0
