Compare commits

...

2 Commits

Author SHA1 Message Date
Nicholas Hope 81942f47f6 ln now mv 2022-11-03 22:42:13 -04:00
Nicholas Hope d96bb7e1c8 initial commit 2022-11-03 22:41:51 -04:00
2 changed files with 30 additions and 4 deletions

28
dostuff.sh Executable file
View File

@ -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

View File

@ -6,7 +6,6 @@ OIFS="$IFS"
IFS=$'\n'
MV="mv"
LN="ln"
[[ -d ~/apt_stuff ]] || mkdir ~/apt_stuff
@ -24,14 +23,13 @@ for file in $(
ls -1 |
egrep -vi \(init\|license\|readme\|git\)
); do
${LN} "$file" "~/.cyber_bin/$file"
${MV} "$file" "~/.cyber_bin/$file"
done
[[ ! -f ~/.bashrc ]] && ${LN} ~/.bash_profile ~/.bashrc
# push changes made to PATH
hash -r
source ~/.bash_profile
bash dostuff.sh
# reset internal field separator
IFS="$OIFS"