diff options
author | Jonas Smedegaard <dr@jones.dk> | 2014-04-17 12:03:18 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2014-04-17 12:03:18 +0200 |
commit | 1e40c8ee8b6d7f4054f268be677de61ed16584e6 (patch) | |
tree | 10d5f553da81748253b70dc563f696c37a31ab50 | |
parent | ba67fc64eb7a77fd15fcb5b63c39e46192ada1ed (diff) |
Separate localrmaccount from localrmstaleaccounts.
-rwxr-xr-x | localrmaccount | 9 | ||||
-rwxr-xr-x | localrmstaleaccounts | 11 |
2 files changed, 10 insertions, 10 deletions
diff --git a/localrmaccount b/localrmaccount new file mode 100755 index 0000000..8424acd --- /dev/null +++ b/localrmaccount @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +u="$1"; shift +p=/var/backups/users-dropped/ +getent passwd "$u" > "$p/$u.getent" +getent group "$u" >> "$p/$u.getent" +deluser --remove-home --backup --backup-to "$p" "$u" diff --git a/localrmstaleaccounts b/localrmstaleaccounts index 17c0f6e..d095f0d 100755 --- a/localrmstaleaccounts +++ b/localrmstaleaccounts @@ -11,15 +11,6 @@ warn() ( echo >&2 "WARNING: $1" ) -backupdeluser() { - set -e - u="$1"; shift - p=/var/backups/users-dropped/ - getent passwd "$u" > "$p/$u.getent" - getent group "$u" >> "$p/$u.getent" - deluser --remove-home --backup --backup-to "$p" "$u" -} - maybestaleuser() { warn "Skipping possibly non-stale account for user $user" } @@ -47,7 +38,7 @@ for user in $@; do continue fi if untouchedinbox "$home" || untouchednewmail "$home"; then - backupdeluser "$user" + localrmaccount "$user" continue fi maybestaleuser "$user" |