initial commit
This commit is contained in:
commit
74412c51a4
9 changed files with 229 additions and 0 deletions
21
create_user
Executable file
21
create_user
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
USER="$1@pve"
|
||||
MAIL="$2"
|
||||
ORGA="$3"
|
||||
PASS="$(openssl rand -base64 24)"
|
||||
|
||||
usage() {
|
||||
printf "usage: $0 <username> <mail> <organisation>\n" $0
|
||||
}
|
||||
|
||||
# check usage
|
||||
[ $# != 3 ] && usage && exit 1
|
||||
|
||||
# create user
|
||||
pveum user add "${USER}" --comment "user account for '${USER}'" --email "${MAIL}" --groups "${ORGA}" --password "${PASS}"
|
||||
|
||||
# print password for user
|
||||
echo "${PASS}"
|
Loading…
Add table
Add a link
Reference in a new issue