Alyssa Smith revised this gist . Go to revision
1 file changed, 1 insertion, 1 deletion
ssh-setup.sh
| @@ -12,7 +12,7 @@ if [ -z $GIT_PASSWORD ]; then | |||
| 12 | 12 | echo -n "Git password: " | |
| 13 | 13 | read -s GIT_PASSWORD | |
| 14 | 14 | fi | |
| 15 | - | git --version || sudo apt install -y git || pkg install -y git || sudo pacman -Sy git | |
| 15 | + | git --version || sudo apt install -y git || pkg install -y git || sudo pacman -Sy git || apk add git | |
| 16 | 16 | git clone https://$GIT_USERNAME:$GIT_PASSWORD@$GIT_HOSTNAME/.ssh.git $TMPDIR/ssh_git | |
| 17 | 17 | if [ -d $HOME/.ssh ]; then | |
| 18 | 18 | find $HOME/.ssh -type f -not -name authorized_keys -not -name config -not -name .gitignore -not -path "$HOME/.ssh/.git*" -exec mv -t $TMPDIR/ssh_git/ {} + && rm -rf $HOME/.ssh | |
Alyssa Smith revised this gist . Go to revision
1 file changed, 23 insertions
ssh-setup.sh(file created)
| @@ -0,0 +1,23 @@ | |||
| 1 | + | #!/bin/bash -x | |
| 2 | + | # curl s.aly.pet/ssh-setup | GIT_HOSTNAME=dotfiles.example.com GIT_USERNAME=you GIT_PASSWORD=password bash -x | |
| 3 | + | if [ -z $GIT_HOSTNAME ]; then | |
| 4 | + | echo -n "Git hostname: " | |
| 5 | + | read -s GIT_HOSTNAME | |
| 6 | + | fi | |
| 7 | + | if [ -z $GIT_USERNAME ]; then | |
| 8 | + | echo -n "Git username: " | |
| 9 | + | read -s GIT_USERNAME | |
| 10 | + | fi | |
| 11 | + | if [ -z $GIT_PASSWORD ]; then | |
| 12 | + | echo -n "Git password: " | |
| 13 | + | read -s GIT_PASSWORD | |
| 14 | + | fi | |
| 15 | + | git --version || sudo apt install -y git || pkg install -y git || sudo pacman -Sy git | |
| 16 | + | git clone https://$GIT_USERNAME:$GIT_PASSWORD@$GIT_HOSTNAME/.ssh.git $TMPDIR/ssh_git | |
| 17 | + | if [ -d $HOME/.ssh ]; then | |
| 18 | + | find $HOME/.ssh -type f -not -name authorized_keys -not -name config -not -name .gitignore -not -path "$HOME/.ssh/.git*" -exec mv -t $TMPDIR/ssh_git/ {} + && rm -rf $HOME/.ssh | |
| 19 | + | fi | |
| 20 | + | chown -R $UID $TMPDIR/ssh_git | |
| 21 | + | find $TMPDIR/ssh_git -type f -exec chmod 600 {} + | |
| 22 | + | find $TMPDIR/ssh_git -type d -exec chmod 700 {} + | |
| 23 | + | mv $TMPDIR/ssh_git $HOME/.ssh | |