1
Files
qnap-rc-scripts/wait_RR
2016-09-04 22:20:40 +03:00

28 lines
616 B
Bash
Executable File

#!/bin/sh
POSTPONE_PFILE=/tmp/postpone-RR.pid
WAIT_FOR_RR=`/sbin/getcfg "Schedule Booting And Shutdown" "Wait RR" -d 0 -f /etc/config/schedule_boot_setting`
if [ "$WAIT_FOR_RR" = "1" ]; then
RR_RUNNING=1
if [ -f $POSTPONE_PFILE ]; then
kill `/bin/cat $POSTPONE_PFILE`
fi
echo $$ > $POSTPONE_PFILE
while [ $RR_RUNNING = 1 ]; do
/bin/ps | /bin/grep /usr/bin | /bin/grep "rsync "
if [ $? != 0 ]; then
RR_RUNNING=0
fi
if [ -f /usr/bin/qsync ]; then
/usr/bin/qsync -busy
if [ 1 = $? ]; then
RR_RUNNING=1
fi
fi
if [ 1 = $RR_RUNNING ]; then
sleep 10
fi
done
rm $POSTPONE_PFILE
fi