diff options
author | Benjamin Morrison <ben@gbmor.org> | 2023-06-12 22:40:57 -0400 |
---|---|---|
committer | Benjamin Morrison <ben@gbmor.org> | 2023-06-12 22:48:29 -0400 |
commit | 127e786b70911bed54c1189e394e6744907395c1 (patch) | |
tree | 6c9c3538214765c07a564bcba9e09b7f16d99d59 /bin/rmuser | |
parent | 36edcab02c713b46a52db3a0dd0271459d57b9e8 (diff) | |
download | admin-master.tar.gz |
Diffstat (limited to 'bin/rmuser')
-rwxr-xr-x | bin/rmuser | 7 |
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" |