Skip to content

Instantly share code, notes, and snippets.

@sourcesimian
Created May 17, 2017 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sourcesimian/ca41f53e3f77df3b888c1c032d263250 to your computer and use it in GitHub Desktop.
Save sourcesimian/ca41f53e3f77df3b888c1c032d263250 to your computer and use it in GitHub Desktop.
Dropin folder to generate ~/.ssh/config
#!/bin/bash
# Put this script in a folder named ssh-config.d
# Add as many contributer files as you line to this folder
# They will be concatenated into ~/.ssh/config in lexical order
echo "### Auto generated by: $0 ###" >~/.ssh/config
for script in $(ls -1 $(dirname $0)/* | grep -v -e "$0" -e "~\$" ); do
echo "" >>~/.ssh/config
echo "# --- Origin: $script --- #" >>~/.ssh/config
cat $script >>~/.ssh/config
done
echo "~/.ssh/config updated from: $(dirname $0)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment