
- 帖子
- 5
- 积分
- 18
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2012-12-22
|
本帖最后由 sunnyseaman 于 2016-8-6 23:15 编辑
没有好办法,先用ping工作吧,谢谢大家的回复,下面的脚本在cron调度下有效:
#!/bin/sh
COMMAND="transmission-remote 127.0.0.1:9091 --auth=root:toor"
busyjob=`ping -c 2 192.168.1.99|grep received|awk '{print $4}'`
if [ $busyjob -eq 0 ]; then
if [ -f "/tmp/boxbusy" ]; then
rm /tmp/boxbusy
transmission-remote 127.0.0.1:9091 --auth=root:toor -D -U
fi
else
if [ ! -f "/tmp/boxbusy" ]; then
echo runhalf >/tmp/boxbusy
transmission-remote 127.0.0.1:9091 --auth=root:toor -d 50 -u 10
fi
fi |
|