#!/usr/bin/env bash TMP=$(mktemp -d) scp "carbon.net.clerie.de:/var/lib/scan-to-gpg/*.asc" "${TMP}" find "${TMP}" -iname "*.asc" | gpg --decrypt-files find "${TMP}" -mindepth 1 -not -iname "*.asc" -type f | xargs mv -t . rm -r "${TMP}"