Fixed bugs in deathwatch and new suicidebashrc

This commit is contained in:
sose 2019-03-22 22:46:15 +01:00
parent bf7e22820a
commit a414c17ac0
5 changed files with 10 additions and 9 deletions

View File

@ -3,7 +3,7 @@
# efficiently checks each user directory to see if the .ssh folder has been deleted
# deletes the user if it has
inotifywait -mrqe delete users | while read -r dir
inotifywait -mre delete users | while read -r dir
do
echo "$dir" | grep -q 'ISDIR .ssh' \
&& ./deluser.sh "$(echo "$dir" | cut -f 2 -d '/')"

View File

@ -11,15 +11,15 @@ then
exit
fi
if ps -o stat= -p $PPID | grep -qv S+ #check if this is being called from listen.py
if ps -o stat= -p $PPID | grep -qv S+ #check if this is being called from deathwatch.sh
then
echo "YOU ARE ABOUT TO PERMANENTLY DELETE USER $SLBRUSER AND ALL OF THEIR DATA. RE-ENTER THE USER'S NAME TO CONTINUE"
read -r ENTEREDUSER
[ "$ENTEREDUSER" != "$SLBRUSER" ] && echo "users did not match, exiting..." && exit
fi
lxc stop "$SLBRUSER"
lxc delete "$SLBRUSER"
sudo rm -rf "/home/slbr/users/$SLBRUSER"
sudo userdel "$SLBRUSER"
sed -i "s/^$SLBRUSER$//g" users.txt
lxc stop --force "$SLBRUSER"
lxc delete --force "$SLBRUSER"
sudo rm -rf "/home/slbr/users/$SLBRUSER"
sudo userdel -f "$SLBRUSER"
sed -i "s/^$SLBRUSER$//g" users.txt
sed -i '/^$/d' users.txt

View File

@ -7,7 +7,7 @@
. /etc/profile.d/apps-bin-path.sh
SLBRUSER="$(whoami)"
lxc list | grep -q "$(echo "$SSH_CLIENT" | cut -f 1 -d ' ')" && ~/killme.sh && exit
lxc list | grep -q "$(echo "$SSH_CLIENT" | cut -f 1 -d ' ')" && ~/killme.sh && exit 0
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

View File

@ -55,7 +55,7 @@ fi
suicidePostCommand() {
if [ $? -ne 0 ]; then
ssh -o "StrictHostKeyChecking no" testuser@10.123.168.1 &
ssh -o "StrictHostKeyChecking no" "$(hostname)@10.123.168.1" "exit 0" &
echo "$(tput setaf 3)====$(tput setaf 1)$(tput bold)YOU HAVE BEEN ELIMINATED$(tput sgr0)$(tput setaf 3)====$(tput sgr0)"
sleep 2
fi

View File

@ -0,0 +1 @@
testuser