From 2cc9078ad9d0f8f283aae4e777d1bf31b964b276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Mon, 29 Nov 2021 12:01:38 +0100 Subject: [PATCH] Rename file list for next run --- duplicati/create.homedir.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/duplicati/create.homedir.sh b/duplicati/create.homedir.sh index a6cb487..dd04ff6 100755 --- a/duplicati/create.homedir.sh +++ b/duplicati/create.homedir.sh @@ -144,6 +144,7 @@ define_vars() { # {{{ ## Temp file vars {{{ readonly ldap_user_list_path="/tmp/${PROGNAME}.ldap.user.list" + readonly ldap_previous_user_list_path="/tmp/.${PROGNAME}.previous.ldap.user.list" ## }}} } # }}} @@ -316,6 +317,11 @@ main() { # {{{ for all members of ${RED}${ldap_group_cn},${ldap_group_base}${COLOR_DEBUG} LDAP group \ from ${RED}${ldap_server}${COLOR_DEBUG} LDAP server ." + ## Rename user list for next run of the script + ## AND exit + mv --force -- "${ldap_user_list_path}" "${ldap_previous_user_list_path}" \ + && exit 0 + } # }}}