~mmach/netext73/mesa-haswell

« back to all changes in this revision

Viewing changes to .gitlab-ci/bare-metal/poe-on

  • Committer: mmach
  • Date: 2022-09-22 19:56:13 UTC
  • Revision ID: netbit73@gmail.com-20220922195613-wtik9mmy20tmor0i
2022-09-22 21:17:09

Show diffs side-by-side

added added

removed removed

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