mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-10 14:04:51 +02:00
Re: "Allow installer to run without sudo & only need it when need to install Docker"
This commit is contained in:
parent
6f3514199a
commit
c997b8625f
1 changed files with 6 additions and 4 deletions
|
@ -58,9 +58,11 @@ func main() {
|
||||||
reader := bufio.NewReader(os.Stdin)
|
reader := bufio.NewReader(os.Stdin)
|
||||||
|
|
||||||
// check if the user is root
|
// check if the user is root
|
||||||
if os.Geteuid() != 0 {
|
if !isDockerInstalled() {
|
||||||
fmt.Println("This script must be run as root")
|
if os.Geteuid() != 0 {
|
||||||
os.Exit(1)
|
fmt.Println("Docker is not installed. Please install Docker manually or run this installer as root.")
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var config Config
|
var config Config
|
||||||
|
@ -619,4 +621,4 @@ func generateRandomSecretKey() string {
|
||||||
b[i] = charset[seededRand.Intn(len(charset))]
|
b[i] = charset[seededRand.Intn(len(charset))]
|
||||||
}
|
}
|
||||||
return string(b)
|
return string(b)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue