forked from tildeverse/SLBR
18 lines
765 B
Bash
Executable File
18 lines
765 B
Bash
Executable File
#!/bin/sh
|
|
. /etc/profile.d/apps-bin-path.sh
|
|
SLBRUSER="$(whoami)"
|
|
lxc list | grep -q "$(echo $SSH_CLIENT | cut -f 1 -d ' ')" && ~/killme.sh && exit #this is a bit hacky, maybe something better?
|
|
echo "The game has not started yet! Grab a cup of tea, or just wait here."
|
|
while test -z "$(cat /home/slbr/gamestatus)" || break
|
|
do
|
|
printf "."
|
|
sleep 1
|
|
done
|
|
echo "READY.......BEGIN!"
|
|
sleep 1
|
|
echo "Setting up your container..."
|
|
lxc exec "$SLBRUSER" ssh-keygen -- -t rsa -N '' -f /root/.ssh/id_rsa
|
|
lxc file pull "$SLBRUSER/root/.ssh/id_rsa.pub" "/home/slbr/users/$SLBRUSER/pubkey.temp"
|
|
cat "/home/slbr/users/$SLBRUSER/pubkey.temp" >> "/home/slbr/users/$SLBRUSER/.ssh/authorized_keys" && rm "/home/slbr/users/$SLBRUSER/pubkey.temp"
|
|
lxc exec "$SLBRUSER" /usr/bin/tmuxinit.sh
|