unraid-zabbix_agent/scripts/disks.discovery.sh

17 lines
280 B
Bash
Raw Normal View History

2020-07-15 03:40:49 +00:00
#!/bin/bash
id='""'
device='""'
first=1
echo -n '['
while IFS="=" read key value; do
if [ "$key" = "id" ] && [ -n "$value" ] && [ "$value" != '""' ]; then
[ $first = 0 ] && echo -n ","
first=0
echo -n '{"{#ID}":'$value'}'
fi
done < /var/local/emhttp/disks.ini
echo ']'