Last active
December 22, 2016 16:09
-
-
Save coffeemancy/f36345cfe8aabf7383127b8e108e6030 to your computer and use it in GitHub Desktop.
Setup oh-my-zsh on remote server when supplied SSHFN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
export IFS=$'\n\t' | |
SSHFN=$@ | |
ohmyzsh="curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -o \~/install.sh" | |
# replace "clark" with non-admin user | |
if [[ $SSHFN == *"clark"* ]]; then | |
echo "Skipping package updates because clark..." | |
else | |
set -x | |
eval $SSHFN "sudo yum makecache fast" \ | |
|| eval $SSHFN "sudo apt-get update" | |
eval $SSHFN "sudo yum install -y git zsh vim tmux" \ | |
|| eval $SSHFN "sudo apt-get install -y git zsh vim tmux" | |
set +x | |
fi | |
set -x | |
eval $SSHFN $ohmyzsh | |
eval $SSHFN "zsh \~/install.sh" | |
eval $SSHFN "sed -i 's/robbyrussell/norm/g' \~/.zshrc" | |
set +x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment