make signup script executable (700)

This commit is contained in:
Arya 2023-01-21 14:26:07 +05:30
parent 0b0f74742c
commit 10b99bb72a
Signed by untrusted user: arya
GPG Key ID: 842D12BDA50DF120

View File

@ -46,8 +46,13 @@ func SignupPage(c *fiber.Ctx) error {
"sed s/REPLACEME/" + username + "/g /home/" + username + "/{meta-info.env,Caddyfile}\n" +
"loginctl enable-linger" + username + "\n" +
"setquota -u " + username + " 20G 20G 0 0 /\n" +
"echo \"" + username + "'s account has been created!\""
"echo \"" + username + "'s account has been created!\"" +
"rm -rf $0"
chmoderr := os.Chmod("/var/publapi/users/"+username+".sh", 0700)
if chmoderr != nil {
log.Error(err)
}
// write to file
_, err = f.WriteString(bashscript)
if err != nil {