From d633ccfb25803fababae4351ccb9b6ee96e9de86 Mon Sep 17 00:00:00 2001 From: Arya K <73596856+gi-yt@users.noreply.github.com> Date: Sat, 7 Jan 2023 21:12:28 +0530 Subject: [PATCH] Add password for the user --- pages/signup.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pages/signup.go b/pages/signup.go index 3b05396..77beb99 100644 --- a/pages/signup.go +++ b/pages/signup.go @@ -41,8 +41,9 @@ func SignupPage(c *fiber.Ctx) error { bashscript := "#!/bin/bash \n" + "# Path: /var/publapi/users/.sh\n" + "# This file is generated by publapi. Do not edit this file.\n" + - "useradd -m -s /bin/bash " + username + "\n" + - "echo " + username + " created!" + "useradd -Um -s /bin/bash " + username + "\n" + + "printf \"%s\n%s\n\" \"" + pass + " " + pass + " | passwd " + username + + "echo " + username + "'s account has been created!" fmt.Println(bashscript)