From e03e99848bc5fbc7ad527513e0aa4b0fc9c4d6fb Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Tue, 22 Oct 2019 10:30:03 -0400 Subject: [PATCH] fix race condition btrbk was unmounting, then rootsshsync was killing off files in /root/.ssh when thing were unmounted. --- rootsshsync | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rootsshsync b/rootsshsync index c4cebbf..1a39d46 100755 --- a/rootsshsync +++ b/rootsshsync @@ -33,6 +33,10 @@ if [[ $SUDO_USER ]]; then fi user_ssh_dir=$(eval echo ~$user)/.ssh +if [[ ! -s $user_ssh_dir/config ]]; then + echo missing $user_ssh_dir/config. bad sign. bailing >&2 + exit 1 +fi # remove broken links, or else rsync has error about them. find $user_ssh_dir -xtype l -exec rm '{}' \; -- 2.30.2