A script that allows admins of thunix to make user accounts easily.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
742 B

#!/bin/bash
# ---------------------------------------------------------------------------
# Thunix user queue management
# ---------------------------------------------------------------------------
source setenv
if [ $# -eq 0 ]
then
echo -e "usage: $0 [u][f][d][a] username"
echo "(u) Print users in queue"
echo "(f) Shows the fields of the selected user"
echo "(a) Accept sign up request"
echo "(d) Delete selected user from queue"
else
if [ $1 = "u" ]
then
awk -F, '{print $1}' $USERQUEUE
else
if [ $# -ne 2 ]
then
echo -e "usage: $0 <$1> <username>"
else
[ $1 = "f" ] && grep -w $2 $USERQUEUE | awk -F, '{print $1, $2, $3}'
[ $1 = "d" ] && sudo sed "/$2/d" -i $USERQUEUE
fi
fi
fi