vim /etc/systemd//system/wol@.service
[Unit]
Description=Wake-on-LAN for %i
Requires=network.target
After=network.target
[Service]
ExecStart=/sbin/ethtool -s %i wol g
Type=oneshot
[Install]
WantedBy=multi-user.target
ip a|grep -i UP
查看需要WOL的网卡名称xxx
sudo systemctl daemon-reload
sudo systemctl enable wol@xxx.service
sudo systemctl start wol@xxx.service
查看xxx的WOL状态
ethtool xxx|grep -i wake