added a more robust install process, updated whitespace in ssh/config

moveTools
Adam Veldhousen 2015-06-24 10:50:55 -05:00
parent f7a9427069
commit 877504a362
Signed by: adam
GPG Key ID: 6DB29003C6DD1E4B
2 changed files with 52 additions and 30 deletions

View File

@ -1,13 +1,13 @@
# some commonly set options # some commonly set options
Host * Host *
LogLevel INFO #verbosity used when logging messages from ssh, QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, DEBUG3 LogLevel INFO #verbosity used when logging messages from ssh, QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, DEBUG3
StrictHostKeyChecking ask #if YES, never auto add host keyes and refuses to connecto to hosts that have changed. YES, NO, ASK StrictHostKeyChecking ask #if YES, never auto add host keyes and refuses to connecto to hosts that have changed. YES, NO, ASK
UserKnownHostsFile ~/.ssh/known_hosts #known hosts file database location UserKnownHostsFile ~/.ssh/known_hosts #known hosts file database location
ServerAliveInterval 30 # timeout in seconds after which if no data has been recieved from the server, ssh will send a keep alive message ServerAliveInterval 30 # timeout in seconds after which if no data has been recieved from the server, ssh will send a keep alive message
ServerAliveCountMax 120 # the number of times to send a keep alive message in a row, only applies to ssh v2 ServerAliveCountMax 120 # the number of times to send a keep alive message in a row, only applies to ssh v2
VisualHostKey yes #Shows the ssh key image on connection. YES or NO VisualHostKey yes #Shows the ssh key image on connection. YES or NO
Compression no #if the connection should compress. YES or NO Compression no #if the connection should compress. YES or NO
PasswordAuthentication yes #If ssh should use password auth. YES or NO PasswordAuthentication yes #If ssh should use password auth. YES or NO
PreferredAuthentications publickey #allows ssh to prefer one method of auth over another if there are multiple methods available. gssapi-with-mic, hostbased, publickey, keyboard-interactive, password PreferredAuthentications publickey #allows ssh to prefer one method of auth over another if there are multiple methods available. gssapi-with-mic, hostbased, publickey, keyboard-interactive, password
TCPKeepAlive yes #send TCP keep alive messages to the host, which lets us know if the connection dies, but it can give false negatives (if the connection goes down temporarily, you'll get disconnected). YES, NO TCPKeepAlive yes #send TCP keep alive messages to the host, which lets us know if the connection dies, but it can give false negatives (if the connection goes down temporarily, you'll get disconnected). YES, NO

View File

@ -2,48 +2,70 @@
IFS='\n\t' IFS='\n\t'
set -euo pipefail set -euo pipefail
source=$(pwd) source="$(pwd)"
bkup=~/home_bkup/ bkup="$source/../home_bkup"
dest=~ dest="$source/.."
echo "Making a backup of old dotfiles into ${bkup}..."
echo "making a backup of old dotfiles into ${bkup}..." rm -rf "${bkup}"
rm -rf ${bkup} mkdir -p "${bkup}"
mkdir -p ${bkup}
IFS=$'\n' IFS=$'\n'
if [[ -f ${dest}/.ssh/config ]]; then if [[ -f ${dest}/.ssh/config ]]; then
mkdir -p "${bkup}/.ssh"
cp "${dest}/.ssh/config" "${bkup}/.ssh/config" cp "${dest}/.ssh/config" "${bkup}/.ssh/config"
fi fi
for file in $(ls -lA "${source}" | grep "^-" | awk '{print $9}'); do for file in $(ls -lA "${source}" | grep "^-" | awk '{print $9}'); do
if [ -f "${dest}/${file}" ]; then if [ -f "${dest}/${file}" ]; then
cp -v "${dest}/${file}" "${bkup}/${file}" cp "${dest}/${file}" "${bkup}/${file}"
fi fi
done done
echo "" echo ""
echo "loading git modules..." echo "loading git modules..."
git submodule init git submodule init
git submodule update git submodule update
echo ""
echo "copying directories..." echo "copying directories..."
cp -rs ${source}/tools ${dest}/tools ln -s ${source}/tools ${dest}/tools
pushd ${dest} 2>&1 /dev/null # sometimes its easier if you just change directories
echo "linking dotfiles from ${source} into ${dest}..." pushd ${dest} 2&> /dev/null
ls -lA "${source}" | grep "^-" | awk '{print $9}' | xargs -I file ln -vfs "${source}/file" "${dest}/file"
cp "${source}/.ssh/config" "${dest}/.ssh/config" echo ""
echo "linking dotfiles from ${source} into ${dest}"
ls -lA "${source}" | grep "^-" | awk '{print $9}' | xargs -I file ln -fs "${source}/file" "${dest}/file"
if [[ -z "${dest}/.ssh" ]]; then
mkdir "${dest}/.ssh"
fi
echo ""
# a check to see if they're using a config file and if it has a host setup
if [[ -f "${dest}/.ssh/config" && -z $(cat "${dest}/.ssh/config" | grep "Host \*") ]]; then
echo "Applying ssh config"
# we copy it so that the config doesn't mess with the repo
cat "${source}/.ssh/config" >> "${dest}/.ssh/config"
elif [[ -z "${dest}/.ssh/config" ]]; then
echo "Copying new ssh config"
cp "${source}/.ssh/config" "${dest}/.ssh/config"
else
echo "Your SSHfu is strong, skipping config copy..."
fi
#set +u #set +u
#curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash #curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
#set -u #set -u
echo "cleaning up..." echo ""
# cleanup echo "Cleaning up..."
rm -rf ${dest}/bootstrap.sh
rm -rf ${dest}/.git rm -rf ${dest}/.git
rm -rf ${dest}/bootstrap.sh
rm -rf ${dest}/remove.sh
rm -rf ${dest}/README.md
popd 2>&1 /dev/null popd 2&> /dev/null
echo "To uninstall, do cd ./lauging-hipster && ./remove.sh"
echo "Make sure your home_bkup folder is present, so keep it safe in the meantime!"
echo "Install ./tools/modules/powerline-fonts and set them up in your terminal to benefit from the custom PS1 in .shell_colors"
echo "done!" echo "done!"