[triggers/ethernet] fix deprecation warning
This commit is contained in:
@@ -3,7 +3,7 @@ package triggers
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"unknown.com/gokill/actions"
|
"unknown.com/gokill/actions"
|
||||||
@@ -17,7 +17,7 @@ type EthernetDisconnect struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func isEthernetConnected(deviceName string) bool {
|
func isEthernetConnected(deviceName string) bool {
|
||||||
content, err := ioutil.ReadFile(fmt.Sprintf("/sys/class/net/%s/operstate", deviceName))
|
content, err := os.ReadFile(fmt.Sprintf("/sys/class/net/%s/operstate", deviceName))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
|||||||
Reference in New Issue
Block a user