From: Ian Kelling Date: Tue, 22 Oct 2019 14:30:03 +0000 (-0400) Subject: fix race condition X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=commitdiff_plain;h=e03e99848bc5fbc7ad527513e0aa4b0fc9c4d6fb fix race condition btrbk was unmounting, then rootsshsync was killing off files in /root/.ssh when thing were unmounted. --- 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 '{}' \;