[ SEA-GHOST MINI SHELL]
#!/bin/bash
sensors=$(ipmitool -I "$1" -H "$2" -U "$3" -P "$4" -L "$5" sdr type "$6" )
first=1
IFS=$'\n'
delimiter=_
echo -ne "{ \"data\" : [\n";
for sensor in $sensors
do
if [[ $(echo ${sensor}| awk -F "|" '{print $3}'| sed 's/ //g') != "ns" ]]; then
name=$(echo ${sensor}| awk -F "|" '{print $1}'| sed 's/[ \t]*$//')
ID=$(echo ${sensor}| awk -F "|" '{print $4}'| sed 's/ //g')
if [ $first == 0 ]; then echo -ne ",\n";
fi
first=0
echo -ne "{"
echo -ne " \"{#SNAME}\" : \"$name$delimiter$ID \" ";
echo -ne " }"
fi
done
echo -ne " ]";
echo -ne " }\n";
SEA-GHOST - SHELL CODING BY SEA-GHOST