about summary refs log tree commit diff stats
path: root/bin/rmuser
diff options
context:
space:
mode:
authorBenjamin Morrison <ben@gbmor.org>2023-06-12 22:40:57 -0400
committerBenjamin Morrison <ben@gbmor.org>2023-06-12 22:48:29 -0400
commit127e786b70911bed54c1189e394e6744907395c1 (patch)
tree6c9c3538214765c07a564bcba9e09b7f16d99d59 /bin/rmuser
parent36edcab02c713b46a52db3a0dd0271459d57b9e8 (diff)
downloadadmin-127e786b70911bed54c1189e394e6744907395c1.tar.gz
wrapper script for adding users in bulk. cleanup and reconcile local changes. HEAD master
Diffstat (limited to 'bin/rmuser')
-rwxr-xr-xbin/rmuser7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/rmuser b/bin/rmuser
index 98c697a..b7f5932 100755
--- a/bin/rmuser
+++ b/bin/rmuser
@@ -1,5 +1,4 @@
 #!/bin/sh
-set -eu
 
 if [ -z "$1" ]; then
 	printf 'Please pass a user as the first argument.\n'
@@ -7,6 +6,12 @@ if [ -z "$1" ]; then
 fi
 
 printf 'Removing user %s from the system\n' "$1"
+
+chflags nouappnd "/home/$1/.history"
+chflags nouappnd "/home/$1/.bash_history"
+
+set -e
+
 userdel -r -v "$1"
 printf 'Cleaning /var/www/users/%s\n' "$1"
 rm -rf "/var/www/users/$1"