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
|
||||
# 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 '/')"
|
||||
|
|
12
deluser.sh
12
deluser.sh
|
@ -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
|
||||
|
|
2
login.sh
2
login.sh
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue