Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/sharedra...
File: raidrunner.sh
#!/bin/bash
[0] Fix | Delete
# VPS RADS Tools, written by Erik Soroka (eriks@imhadmin.net, ext 834)
[1] Fix | Delete
# this script gets executed by crontab to dump battery level to a file
[2] Fix | Delete
[3] Fix | Delete
#####################################################################
[4] Fix | Delete
### CHECK AND STORE THE RAID CONTROLLER'S BATTERY LIFE
[5] Fix | Delete
#####################################################################
[6] Fix | Delete
[7] Fix | Delete
MEGA64=/opt/MegaRAID/MegaCli/MegaCli64
[8] Fix | Delete
MEGA32=/opt/MegaRAID/MegaCli/MegaCli
[9] Fix | Delete
[10] Fix | Delete
if [ -f $MEGA64 ]; then
[11] Fix | Delete
$MEGA64 -AdpBbuCmd -GetBbuStatus -aALL | awk '$0~/Relative State of Charge/ {print $(NF-1)}' > /home/nagios/raid_battery_level
[12] Fix | Delete
elif [ -f $MEGA32 ]; then
[13] Fix | Delete
$MEGA32 -AdpBbuCmd -GetBbuStatus -aALL | awk '$0~/Relative State of Charge/ {print $(NF-1)}' > /home/nagios/raid_battery_level
[14] Fix | Delete
fi
[15] Fix | Delete
[16] Fix | Delete
chown nagios.nagios /home/nagios/raid_battery_level
[17] Fix | Delete
[18] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function