SLBR/killme.sh

18 lines
526 B
Bash
Raw Normal View History

2018-10-11 04:50:26 +00:00
#!/bin/sh
# killme.sh
# deletes a user's .ssh folder signifying they have been eliminated
# run by the user's account, hopefully without their control
# This should only be run by users who have been eliminated, obviously
2018-10-11 04:50:26 +00:00
SLBRUSER=$(whoami)
test -z "$SLBRUSER" && echo "no user provided" && exit
if ! (grep -qE "^$SLBRUSER$" /home/slbr/users.txt)
2018-10-11 04:50:26 +00:00
then
echo "user not found in users.txt, will not delete"
exit
fi
echo "removing /home/slbr/users/$SLBRUSER"
rm -rf "/home/slbr/users/$SLBRUSER/.ssh"
lxc delete -f "$SLBRUSER"