summaryrefslogtreecommitdiff
path: root/scripts/ipmiutil.setup
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2014-07-06 18:04:32 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2014-07-06 18:04:32 +0200
commita7f89980e5b3f4b9a74c70dbc5ffe8aabd28be28 (patch)
tree41c4deec1fdfbafd7821b4ca7a9772ac0abd92f5 /scripts/ipmiutil.setup
Imported Upstream version 2.9.3upstream/2.9.3
Diffstat (limited to 'scripts/ipmiutil.setup')
-rwxr-xr-xscripts/ipmiutil.setup47
1 files changed, 47 insertions, 0 deletions
diff --git a/scripts/ipmiutil.setup b/scripts/ipmiutil.setup
new file mode 100755
index 0000000..9087021
--- /dev/null
+++ b/scripts/ipmiutil.setup
@@ -0,0 +1,47 @@
+#! /bin/sh
+# ipmiutil ipmi_port setup script for systemd
+#
+
+. /usr/share/ipmiutil/ipmiutil.env
+
+getpid () {
+ # This is messy if the parent script is same name as $1
+ p=`ps -ef |grep "$1" |grep -v grep |awk '{print $2}'`
+ echo $p
+}
+
+isetup() {
+ retval=1
+ PID=0
+
+ mkdir -p $IVARDIR
+ if [ ! -f $ISENSOROUT ]; then
+ # Capture a snapshot of IPMI sensor data for later reuse.
+ ipmiutil sensor -q >$ISENSOROUT
+ fi
+ if [ -f $ITHRESH ]
+ then
+ # apply saved IPMI sensor thresholds, if any
+ sh $ITHRESH
+ fi
+ if [ -d ${IMIBDIR} ]
+ then
+ # put bmclanpet MIB where SNMP can find it
+ cp -f $IDATADIR/bmclanpet.mib ${IMIBDIR}/BMCLAN-PET-MIB.txt
+ fi
+
+ dpc=`getpid dpcproxy`
+ if [ "x${dpc}" != "x" ]
+ then
+ echo "dpcproxy is already running on port 623, so not needed."
+ retval=6
+ else
+ # portmap may have been replaced by portreserve
+ [ -x $IPORTMAP ] || exit 6
+ retval=0
+ fi
+ return $retval
+}
+
+isetup
+