From 1e40c8ee8b6d7f4054f268be677de61ed16584e6 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 17 Apr 2014 12:03:18 +0200 Subject: Separate localrmaccount from localrmstaleaccounts. --- localrmaccount | 9 +++++++++ localrmstaleaccounts | 11 +---------- 2 files changed, 10 insertions(+), 10 deletions(-) create mode 100755 localrmaccount 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" -- cgit v1.2.3