File: init.sh

package info (click to toggle)
ipmiutil 3.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,436 kB
  • ctags: 11,679
  • sloc: ansic: 71,653; sh: 14,503; cpp: 2,242; makefile: 502
file content (36 lines) | stat: -rwxr-xr-x 933 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
#    init.sh - run this at install time if rpm postinstall not used
#
sbindir=/usr/bin
vardir=/var/lib/ipmiutil
datadir=/usr/share/ipmiutil
sensorout=$vardir/sensor_out.txt

  if [ -x $datadir/setlib.sh ]; then
     $datadir/setlib.sh 
  fi

  mkdir -p $vardir
  if [ ! -f $vardir/ipmi_if.txt ]; then
      $datadir/ipmi_if.sh
  fi

  # Run some ipmiutil command to see if any IPMI interface works.
  $sbindir/ipmiutil wdt >/dev/null 2>&1
  IPMIret=$?

  # If IPMIret==0, the IPMI cmd was successful, and IPMI is enabled locally.
  if [ $IPMIret -eq 0 ]; then
     # IPMI_IS_ENABLED, so enable services
     if [ -x /sbin/chkconfig ]; then
	/sbin/chkconfig --add ipmi_port
	/sbin/chkconfig --add ipmiutil_wdt
	/sbin/chkconfig --add ipmiutil_asy 
     fi

     # Capture a snapshot of IPMI sensor data once now for later reuse.
     if [ ! -f $sensorout ]; then
        $sbindir/ipmiutil sensor -q >$sensorout
     fi
  fi