mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-10 05:54:58 +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)
|
||||
|
||||
// check if the user is root
|
||||
if os.Geteuid() != 0 {
|
||||
fmt.Println("This script must be run as root")
|
||||
os.Exit(1)
|
||||
if !isDockerInstalled() {
|
||||
if os.Geteuid() != 0 {
|
||||
fmt.Println("Docker is not installed. Please install Docker manually or run this installer as root.")
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
var config Config
|
||||
|
@ -619,4 +621,4 @@ func generateRandomSecretKey() string {
|
|||
b[i] = charset[seededRand.Intn(len(charset))]
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue