Matches ctl version to upstream
This commit is contained in:
12
clitools/pkg/system/hostname_linux.go
Normal file
12
clitools/pkg/system/hostname_linux.go
Normal file
@@ -0,0 +1,12 @@
|
||||
//go:build linux
|
||||
|
||||
package system
|
||||
|
||||
import "golang.org/x/sys/unix"
|
||||
|
||||
func SetHostname(hostname string) error {
|
||||
if hostname == "" {
|
||||
return nil
|
||||
}
|
||||
return unix.Sethostname([]byte(hostname))
|
||||
}
|
||||
Reference in New Issue
Block a user