diff --git a/src/freedombone-base-email b/src/freedombone-base-email index 842bb73c..4e576aee 100755 --- a/src/freedombone-base-email +++ b/src/freedombone-base-email @@ -545,7 +545,15 @@ function email_archiving { git checkout $CLEANUP_MAILDIR_COMMIT -b $CLEANUP_MAILDIR_COMMIT set_completion_param "cleanup-maildir commit" "$CLEANUP_MAILDIR_COMMIT" - cp $INSTALL_DIR/cleanup-maildir/cleanup-maildir /usr/bin + if [ ! -f /usr/bin/cleanup-maildir ]; then + cp $INSTALL_DIR/cleanup-maildir/cleanup-maildir /usr/bin + else + HASH1=$(sha256sum $INSTALL_DIR/cleanup-maildir/cleanup-maildir | awk -F ' ' '{print $1}') + HASH2=$(sha256sum /usr/bin/cleanup-maildir | awk -F ' ' '{print $1}') + if [[ "$HASH1" != "$HASH2" ]]; then + cp $INSTALL_DIR/cleanup-maildir/cleanup-maildir /usr/bin + fi + fi mark_completed $FUNCNAME }