Create googs users from Shell script


#1

Hello.
I want to crete gogs users by using a script Shell.
Is there a git command line dedicate to this task? If yes, what is and/or how to do it?
Cordially.
Liloulinx


#2

Hello.
I found the solution. Use this:

my_var="{\"username\": \"$username\", \"email\": \"$email_user\", \"password\": \"$user_password\", \"organisation\": \"$myorganisation\"}"
        curl \
            -X POST\
            -H "Content-Type: application/json"\
            -d "$my_var"\
            -u $git_admin_username:"${git_admin_password}" "$api_git_server_addr"

I hope that help you.
Crdly


#3

You can use ./gogs admin xxx to do some operations on command line.