makeuser/makeuser

39 lines
887 B
Plaintext
Raw Normal View History

2018-09-20 15:18:17 +00:00
#!/bin/bash
# ---------------------------------------------------------------------------
2019-03-27 18:28:49 +00:00
# makeuser - tilde new user creation
# Usage: makeuser [-h|--help] <username> <email> "<pubkey>"
2018-09-20 15:18:17 +00:00
# ---------------------------------------------------------------------------
2019-03-27 18:28:49 +00:00
#
# Forked from tilde.team's make user script (
2018-09-20 15:18:17 +00:00
PROGNAME=${0##*/}
2019-03-27 18:28:49 +00:00
VERSION="0.4"
2019-11-05 15:57:19 +00:00
GEN_TDP="./gen_tdp"
2019-12-06 13:01:38 +00:00
CONFIG=./setenv
2019-11-05 15:57:19 +00:00
2019-12-06 13:01:38 +00:00
. $CONFIG
2018-09-20 14:04:19 +00:00
2019-12-12 20:15:11 +00:00
source include/functions
2018-12-15 01:29:03 +00:00
2019-03-27 18:28:49 +00:00
[[ $(id -u) == 0 ]] && error_exit "Do not run this script as root."
case $1 in
-h | --help)
usage; exit ;;
-* | --*)
usage; error_exit "unknown option $1" ;;
*)
2021-01-05 12:42:45 +00:00
[[ $# -ne 3 ]] && error_exit "not enough args"
$(sudo grep -qiw $1 $BANNED) && error_exit "$1 is on the ban list!"
2021-01-03 14:31:52 +00:00
#adding new user
makeuser_no_ansible $1 $2
add_account_recovery $1 $2
2019-03-27 18:28:49 +00:00
#Thunix specific section
source include/ansible.sh
2019-03-27 18:28:49 +00:00
# End Thunix specific section
;;
esac
2018-09-21 14:04:48 +00:00