summaryrefslogtreecommitdiff
path: root/new_user_created.sh
blob: 4328d4741cd512bf167c6d57e259e7c1ef2fcb37 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

read method type key <$SSH_USER_AUTH
user="$(grep -l -s -r -P '^\s*auth:\s*\Q'"$type"'\E\s+\Q'"$key"'\E$' /opt/autopeer/dn42-registry/data/mntner/ | perl -ne 's@^.*/@@; s@-MNT$@@; print lc;' | head -1)"

if getent passwd "$user" >/dev/null 2>&1; then
	echo "Your account has been created, go ahead and log in: shh $user@$(hostname -f)"
else
	echo "An error occurred, the account $user didn't get created, please go ask steering" >&2
	exit 1
fi