![我嘗試在區域網路上喚醒,但收到 ethtool: command not found 錯誤](https://rvso.com/image/1304103/%E6%88%91%E5%98%97%E8%A9%A6%E5%9C%A8%E5%8D%80%E5%9F%9F%E7%B6%B2%E8%B7%AF%E4%B8%8A%E5%96%9A%E9%86%92%EF%BC%8C%E4%BD%86%E6%94%B6%E5%88%B0%20ethtool%3A%20command%20not%20found%20%E9%8C%AF%E8%AA%A4.png)
這讓我發瘋……我已經用谷歌搜尋了一個小時了,但一無所獲!
我正在嘗試呼叫這個腳本:
#!/bin/bash
ethtool -s eth0 wol g
exit
我運行它作為根:/etc/init.d/wakeonlanconfig
它給出:/etc/init.d/wakeonlanconfig:第 2 行:ethtool:找不到指令
有什麼想法嗎?
答案1
shell環境的路徑變數沒有ethtool所在的目錄。因此,要么將其添加到您的路徑中,要么更好,只需在“ethtool”前面加上完整路徑即可:/foo/bar/ethtool