我嘗試在區域網路上喚醒,但收到 ethtool: command not found 錯誤

我嘗試在區域網路上喚醒,但收到 ethtool: command not found 錯誤

這讓我發瘋……我已經用谷歌搜尋了一個小時了,但一無所獲!

我正在嘗試呼叫這個腳本:

#!/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

相關內容