|
设置了下载工具下载完自动关机,一旦win7 关机,数分钟后群晖也关了。
脚本:
- #!/bin/sh
- MonitorIP=192.168.221.253
- DelayTime=240s
- if ping $MonitorIP -W 2 -w 2 -c 2 | grep 'time=' > /dev/null
- then
- echo "Power on."
- else
- synologset1 sys warn 0x11600036
- sleep $DelayTime
- if ping $MonitorIP -W 2 -w 2 -c 2 | grep 'time=' > /dev/null
- then
- synologset1 sys warn 0x11600035
- else
- synologset1 sys warn 0x11600037
- echo "Poweroff."
- poweroff
- fi
- fi
- exit 0
复制代码 |
|