File: create_user

package info (click to toggle)
restic-rest-server 0.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 816 kB
  • sloc: sh: 76; makefile: 7
file content (16 lines) | stat: -rwxr-xr-x 318 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

if [ -z "$1" ]; then
    echo "create_user [username]"
    echo "or"
    echo "create_user [username] [password]"
    exit 1
fi

if [ -z "$2" ]; then
    # password from prompt
    htpasswd -B "$PASSWORD_FILE" "$1"
else
    # read password from command line
    htpasswd -B -b "$PASSWORD_FILE" "$1" "$2"
fi