From d96bb7e1c80db5635e5b0770c5dc73add16be78a Mon Sep 17 00:00:00 2001 From: nick Date: Thu, 3 Nov 2022 22:41:51 -0400 Subject: [PATCH] initial commit --- dostuff.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 dostuff.sh diff --git a/dostuff.sh b/dostuff.sh new file mode 100755 index 0000000..6255b31 --- /dev/null +++ b/dostuff.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +function getextras { + diff - "$1" | + grep '>' - | + cut -b 3- +} + +sort users.txt > usrtmp +mv usrtmp users.txt + +ls /home | + sort | + getextras users.txt | + while read name; do + echo deluser $name + done + +sort admins.txt > admtmp +mv admtmp admins.txt + +grep 'adm' /etc/group | + cut -f 4 -d ':' | + tr ',' '\n' | + sort | + getextras admins.txt + +echo sudo ufw enable \ No newline at end of file