etherwake
命令需要在具有适当的权限下运行,并且需要安装 ethtool
软件包。该命令的语法如下:
etherwake [选项] MAC地址
其中,MAC地址
是要唤醒设备的MAC地址。
如果要使用 etherwake
命令唤醒具有特定MAC地址的设备,可以将 eth0
替换为实际的网络接口名称,并将 MAC地址
替换为要唤醒设备的MAC地址。例如:
etherwake -i eth0 00:11:22:33:44:55
这将使用 eth0
网络接口唤醒MAC地址为 00:11:22:33:44:55
的设备。请注意,为了成功唤醒设备,需要设备所在网络中的其他设备支持唤醒功能。
脚本
#!/bin/bash
mac_1="80:FA:5B:56:A7:D7"
etherwake -i eth0 $mac_1