Witam
mam taki skrypt i nie wiem czemu nie działa...
Czy ktroś mógłby mi pomóc ?
Dzięki z góry...
#!/bin/bash
#Usage: check_raid.sh
ra=(md0) #all available raid arrays
count_ra=${#ra}
for ((i=0;i<$count_ra;i++)); do
if [ $(grep -A1 ${ra[${i}]} /proc/mdstat | grep UU | wc -l) -gt 0 ]; then
#send email if one the raid arrays fails..
mdadm --detail /dev/${ra[${i}]} | mail -s "${ra[${i}]} RAID Array failed" admin
fi
done
Efekt:
./alert_raid.sh
./alert_raid.sh: line 9: 1467 Done mdadm --detail /dev/${ra[${i}]}
1468 Segmentation fault | mail -s "${ra[${i}]} RAID Array failed" admin