1
0
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:
Josh Curl
2016-08-12 11:05:16 -07:00
parent 889cb9eea8
commit c67475cbaa
10 changed files with 359 additions and 172 deletions

View File

@@ -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
}