Script to send secrets

main
earnest ma 2022-06-22 18:08:34 -04:00
parent cc945d0568
commit c1195fad46
Signed by: earnest ma
GPG Key ID: A343F43342EB6E2A
3 changed files with 20 additions and 2 deletions

View File

@ -33,8 +33,10 @@ brew "onefetch"
brew "openjdk"
brew "pinentry-mac"
brew "poetry"
brew "pyright"
brew "restic"
brew "ripgrep"
brew "rsync"
brew "rust-analyzer"
brew "rustup-init"
brew "shellcheck"

16
bin/.local/bin/sendsecrets Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Send secrets from certain files to another trusted device.
# WILL NOT DELETE FILES, BUT WILL OVERWRITE!
set -x
if [[ -z $1 ]]; then
echo "Missing user@host to send to"
exit 2
fi
files="$HOME/.ssh $HOME/.gnupg $HOME/.wakatime.cfg"
rsync -rav \
--exclude="$HOME/.ssh/id_*" --exclude="*.sock" \
$files "${1}:"