summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-04-17 12:03:18 +0200
committerJonas Smedegaard <dr@jones.dk>2014-04-17 12:03:18 +0200
commit1e40c8ee8b6d7f4054f268be677de61ed16584e6 (patch)
tree10d5f553da81748253b70dc563f696c37a31ab50
parentba67fc64eb7a77fd15fcb5b63c39e46192ada1ed (diff)
Separate localrmaccount from localrmstaleaccounts.
-rwxr-xr-xlocalrmaccount9
-rwxr-xr-xlocalrmstaleaccounts11
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"