mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-29 14:18:26 +02:00
Revert "Allow installer to run without sudo & only need it when need to install Docker"
This reverts commit 56fd366a7d
.
This commit is contained in:
parent
56fd366a7d
commit
6f3514199a
1 changed files with 7 additions and 10 deletions
|
@ -57,6 +57,12 @@ type Config struct {
|
|||
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)
|
||||
}
|
||||
|
||||
var config Config
|
||||
|
||||
// check if there is already a config file
|
||||
|
@ -75,15 +81,6 @@ func main() {
|
|||
moveFile("config/docker-compose.yml", "docker-compose.yml")
|
||||
|
||||
if !isDockerInstalled() && runtime.GOOS == "linux" {
|
||||
// Prompt to install Docker if not installed
|
||||
// But only if the user is root, otherwise we exit with an error message
|
||||
if os.Geteuid() != 0 {
|
||||
fmt.Println("Docker is not installed. Please install Docker manually or run this installer as root.")
|
||||
fmt.Println("You can run this installer with 'sudo' to install Docker automatically.")
|
||||
fmt.Println("Exiting...")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if readBool(reader, "Docker is not installed. Would you like to install it?", true) {
|
||||
installDocker()
|
||||
}
|
||||
|
@ -622,4 +619,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