diff --git a/README.md b/README.md index 2a6620e..74ffed9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,35 @@ -# SLBR +# SUICIDE LINUX BATTLE ROYALE +coming soon! check #slbr on irc for updates! +typo? you're out. + +when you play, you'll be dropped in a fresh vm. on the way to your goal, any mistyped command will delete your vm and you'll be eliminated. + +contact ~ben or sose on tilde.chat (in the #slbr channel) to sign up. + +## Prerequisites +- LXC +- LXD with an lxdbr0 device configured +- BSD style netcat +- Tmux +- Python 3 +- An open ssh port + +## Setup +- Switch to the directory you would like to run SLBR in. +- `git clone https://tildegit.org/tildeverse/SLBR` +- `cd SLBR` +- `ln -s $PWD/* ..` +- `cd ..` + +## Running the game +- Run `./listen.py` to start the death listener. +- Run `./newuser.sh [user]` to create new users as you see fit. +- Run `./deluser.sh [user]` to delete a user. (this is done automatically when a user types a command incorrectly) +- Once all of your users are created and logged in, run `echo "1" > gamestatus` to start the game. + +## TODO +- Handling of ssh keys and/or passwords +- Install-time configuration (setting proper ips, hostname, etc.) + +This is a ~ work in progress ~ diff --git a/listen.py b/listen.py index 3b43ec5..4a3411c 100755 --- a/listen.py +++ b/listen.py @@ -21,7 +21,7 @@ def clientthread(conn): log.close() print("sending message") - os.system("tail -n1 gamelog.txt | ./sendmsg.sh") # oh noooooo + os.system("./sendmsg.sh \"$(tail -n1 gamelog.txt)\"") # oh noooooo print("sent message: " + message) userisdead = ( diff --git a/sendmsg.sh b/sendmsg.sh index 6320d75..1b2f905 100755 --- a/sendmsg.sh +++ b/sendmsg.sh @@ -1,9 +1,7 @@ #!/bin/bash -function send { - ADDRESSES=$(lxc list | cut -f 4 -d '|' \ - | grep -Eo "[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*") - for ADDRESS in $ADDRESSES - do - echo "$1" | nc -q2 "$ADDRESS" 9090 - done -} +ADDRESSES=$(lxc list | cut -f 4 -d '|' \ + | grep -Eo "[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*") +for ADDRESS in $ADDRESSES +do + echo "$1" | nc -q2 "$ADDRESS" 9090 +done diff --git a/suicidebash.bashrc b/suicidebash.bashrc index 8bcf543..2b99481 100644 --- a/suicidebash.bashrc +++ b/suicidebash.bashrc @@ -54,5 +54,7 @@ if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; t fi function command_not_found_handle { - echo "$(hostname) has been eliminated by '$1'" | nc -q2 10.161.77.1 9191 + echo "$(hostname) has been eliminated by '$1'" | nc -q2 test.tilde.team 9090 & + echo "====YOU HAVE BEEN ELIMINATED====" + sleep 2 }