群晖主要通过IPV6进行公网链接,最近运营商每天发新的IPV6地址,群晖远程要重启后才能获取新的IPV6地址。每天重启很烦躁,准备通过crontab设置每小时自动重启网络,但是群晖好像没有service network restart命令。请教各位群晖重启网络命令或者这种情况可以处理?
/etc/rc.network restart ChatGPT 参考代码,添加计划任务 代码: #!/bin/bash # IPv6 is down! Now try restarting! if [[ $(ip addr show | grep -E 'inet6 24.*' | wc -l) -gt 0 ]]; then if ping6 -q -c 1 2400:3200::1 >/dev/null 2>&1 ; then echo "IPv6 Network connection successful!" else echo "IPv6 is down! Now try restarting..." /etc/rc.network restart fi else echo "The network interface does not have a public IPv6 address!" fi