Initial commit
This commit is contained in:
commit
968d09e362
88 changed files with 2323 additions and 0 deletions
20
contestops/assign-user.sh
Executable file
20
contestops/assign-user.sh
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
machinename="$1"
|
||||
username="$2"
|
||||
|
||||
machineusername=contestant
|
||||
|
||||
userline=$(grep "^$username;" contestants.csv)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "User $username not found"
|
||||
exit 1
|
||||
fi
|
||||
fullname=$(echo "$userline" | cut "-d;" -f2)
|
||||
|
||||
# Set real name of machine user
|
||||
ssh -F local.ssh_config "$machinename" chfn --full-name "\"$fullname\"" $machineusername
|
||||
|
||||
# Install client certificate
|
||||
scp -F local.ssh_config "certs/$username.p12" "$machinename:/home/$machineusername/clientcert.p12"
|
||||
ssh -F local.ssh_config "$machinename" install-client-cert $machineusername
|
||||
Loading…
Add table
Add a link
Reference in a new issue