ssh-reg/private/scripts/delusers.sh
darksider3 93e846e775 Big restructure of all directories:
config regarding ssh-reg into ssh-reg repository,
config regarding ssh and logins itself into config/etc

administrate.py to private/
userapplications.py to public/
scripts to private/scripts/
2019-09-23 23:17:21 +02:00

11 lines
263 B
Bash
Executable file

#!/bin/bash
cut -d: -f1 /etc/passwd | grep test > deltest.txt
while read name; do
userdel "$name"
rm -rf /home/$name
if [ "$#" -eq 1 ]; then
sqlite3 -batch $1 "DELETE FROM applications WHERE username = '$name'"
fi
done < deltest.txt
rm -f deltest.txt