#!/bin/sh
##############################################################################
#
#  Copyright (c) 2011, Doremi Labs, Inc.
#    All rights reserved.
#
#  Redistribution in source or binary forms, with or without
#  modification, are NOT permitted.
#
#    Doremi Labs, Inc.
#    1020 Chestnut St.
#    Burbank, CA 91506
#    Tel : (818) 562 1101
#    Fax : (818) 562 1109
#
# HMO: fix to report correct status for linear and stripping RAID
# HMO: add .$$ identification in temporrary file to prevent race conflict
# HMO: change ipmi temporary filename to prevent race conflict
# HMO: add number of drives in RAID table
# HMO: process board information only once
# HMO: booting device properties added
#
##############################################################################

# for definition of motherboard_model()
. /etc/init.d/drmfunctions
. /doremi/etc/init.d/snmp.sh

SBCSETUP=/doremi/sbin/sbcsetup.out

#
# SecurityManager
#

echo -n "MD RTC battery" > $SNMP_PATH/VOLT_MD_RTC_title
if board_type "clarity" || board_type "certainty" || board_type "fusion" || board_type "np4000"; then
	res=$($SBCSETUP -a --get-voltage)
	if [ $? -eq 0 ]; then
		echo $res | grep 'TamperVoltage' | awk '{print $2}' > $SNMP_PATH/VOLT_MD_RTC_value
	fi
fi
# write bootup default value
test -r $SNMP_PATH/VOLT_MD_RTC_value || echo -n "0" > $SNMP_PATH/VOLT_MD_RTC_value

