• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3if [ -z "$BM_POE_INTERFACE" ]; then
4    echo "Must supply the PoE Interface to power up"
5    exit 1
6fi
7
8if [ -z "$BM_POE_ADDRESS" ]; then
9    echo "Must supply the PoE Switch host"
10    exit 1
11fi
12
13SNMP_KEY="SNMPv2-SMI::mib-2.105.1.1.1.3.1.`expr 48 + $BM_POE_INTERFACE`"
14SNMP_ON="i 1"
15SNMP_OFF="i 2"
16
17flock /var/run/poe.lock -c "snmpset -v2c -r 3 -t 30 -cmesaci $BM_POE_ADDRESS $SNMP_KEY $SNMP_OFF"
18sleep 3s
19flock /var/run/poe.lock -c "snmpset -v2c -r 3 -t 30 -cmesaci $BM_POE_ADDRESS $SNMP_KEY $SNMP_ON"
20