David K. Bainbridge | 528b318 | 2017-01-23 08:51:59 -0800 | [diff] [blame] | 1 | // Copyright 2011, 2012, 2013 Canonical Ltd. |
2 | // Licensed under the LGPLv3, see LICENCE file for details. | ||||
3 | |||||
4 | package utils | ||||
5 | |||||
6 | import ( | ||||
7 | "strings" | ||||
8 | ) | ||||
9 | |||||
10 | // IsUbuntu executes lxb_release to see if the host OS is Ubuntu. | ||||
11 | func IsUbuntu() bool { | ||||
12 | out, err := RunCommand("lsb_release", "-i", "-s") | ||||
13 | if err != nil { | ||||
14 | return false | ||||
15 | } | ||||
16 | return strings.TrimSpace(out) == "Ubuntu" | ||||
17 | } |