forked from boyska/feedpanel
adduser subcommand addedd
This commit is contained in:
parent
0a2388168b
commit
63fbf784aa
1 changed files with 14 additions and 1 deletions
|
@ -33,8 +33,21 @@ func cmdSetup() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func cmdAddUser(user, email, pwdhash string) error {
|
||||||
|
db := getDB()
|
||||||
|
err := db.UserAdd(user, group, pwdhash)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintln(os.Stderr, err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
fmt.Println("All done")
|
||||||
|
os.Exit(0)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
var cmdMap map[string]commandFunc = map[string]commandFunc{
|
var cmdMap map[string]commandFunc = map[string]commandFunc{
|
||||||
"setup": cmdSetup,
|
"setup": cmdSetup,
|
||||||
|
"adduser": cmdAddUser,
|
||||||
}
|
}
|
||||||
|
|
||||||
func usage(w io.Writer) {
|
func usage(w io.Writer) {
|
||||||
|
|
Loading…
Reference in a new issue