root@NAS:~# bash -x /boot/config/s3.sh
' drives='/dev/sda /dev/sdb /dev/sdc
+ timeout=$'15\r'
+ count=$'15\r'
/boot/config/s3.sh: line 21: syntax error near unexpected token `done'
/boot/config/s3.sh: line 21: `done'
root@NAS:~# cat /boot/config/s3.sh
#!/bin/bash
drives="/dev/sda /dev/sdb /dev/sdc"
timeout=15
count=15
while [ 1 ]
do
hdparm -C $drives | grep -q active
if [ $? -eq 1 ]
then
count=$[$count-1]
else
count=$timeout
fi
if [ $count -le 0 ]
then
powerdown
fi
# Wait a minute
echo COUNT $count
sleep 60
done
root@NAS:~#
Somebody help me!