You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ssh-reg/private/scripts/delusers.sh

12 lines
263 B
Bash

#!/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