Fixed bugs in deathwatch and new suicidebashrc
This commit is contained in:
parent
bf7e22820a
commit
a414c17ac0
|
@ -3,7 +3,7 @@
|
||||||
# efficiently checks each user directory to see if the .ssh folder has been deleted
|
# efficiently checks each user directory to see if the .ssh folder has been deleted
|
||||||
# deletes the user if it has
|
# deletes the user if it has
|
||||||
|
|
||||||
inotifywait -mrqe delete users | while read -r dir
|
inotifywait -mre delete users | while read -r dir
|
||||||
do
|
do
|
||||||
echo "$dir" | grep -q 'ISDIR .ssh' \
|
echo "$dir" | grep -q 'ISDIR .ssh' \
|
||||||
&& ./deluser.sh "$(echo "$dir" | cut -f 2 -d '/')"
|
&& ./deluser.sh "$(echo "$dir" | cut -f 2 -d '/')"
|
||||||
|
|
12
deluser.sh
12
deluser.sh
|
@ -11,15 +11,15 @@ then
|
||||||
exit
|
exit
|
||||||
fi
|
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
|
then
|
||||||
echo "YOU ARE ABOUT TO PERMANENTLY DELETE USER $SLBRUSER AND ALL OF THEIR DATA. RE-ENTER THE USER'S NAME TO CONTINUE"
|
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
|
read -r ENTEREDUSER
|
||||||
[ "$ENTEREDUSER" != "$SLBRUSER" ] && echo "users did not match, exiting..." && exit
|
[ "$ENTEREDUSER" != "$SLBRUSER" ] && echo "users did not match, exiting..." && exit
|
||||||
fi
|
fi
|
||||||
lxc stop "$SLBRUSER"
|
lxc stop --force "$SLBRUSER"
|
||||||
lxc delete "$SLBRUSER"
|
lxc delete --force "$SLBRUSER"
|
||||||
sudo rm -rf "/home/slbr/users/$SLBRUSER"
|
sudo rm -rf "/home/slbr/users/$SLBRUSER"
|
||||||
sudo userdel "$SLBRUSER"
|
sudo userdel -f "$SLBRUSER"
|
||||||
sed -i "s/^$SLBRUSER$//g" users.txt
|
sed -i "s/^$SLBRUSER$//g" users.txt
|
||||||
sed -i '/^$/d' users.txt
|
sed -i '/^$/d' users.txt
|
||||||
|
|
2
login.sh
2
login.sh
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
. /etc/profile.d/apps-bin-path.sh
|
. /etc/profile.d/apps-bin-path.sh
|
||||||
SLBRUSER="$(whoami)"
|
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."
|
echo "The game has not started yet! Grab a cup of tea, or just wait here."
|
||||||
while test -z "$(cat /home/slbr/gamestatus)" || break
|
while test -z "$(cat /home/slbr/gamestatus)" || break
|
||||||
do
|
do
|
||||||
|
|
|
@ -55,7 +55,7 @@ fi
|
||||||
|
|
||||||
suicidePostCommand() {
|
suicidePostCommand() {
|
||||||
if [ $? -ne 0 ]; then
|
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)"
|
echo "$(tput setaf 3)====$(tput setaf 1)$(tput bold)YOU HAVE BEEN ELIMINATED$(tput sgr0)$(tput setaf 3)====$(tput sgr0)"
|
||||||
sleep 2
|
sleep 2
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue