mirror of
https://github.com/rancher/os.git
synced 2025-08-31 22:32:14 +00:00
Rewrite console.sh and docker-init in Go
This commit is contained in:
10
util/util.go
10
util/util.go
@@ -231,3 +231,13 @@ func UnescapeKernelParams(s string) string {
|
||||
s = strings.Replace(s, `\'`, `'`, -1)
|
||||
return s
|
||||
}
|
||||
|
||||
func ExistsAndExecutable(path string) bool {
|
||||
info, err := os.Stat(path)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
mode := info.Mode().Perm()
|
||||
return mode&os.ModePerm != 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user