Haha, merge conflicts on stashes went brrrr
Signed-off-by: Andrei Jiroh Eugenio Halili <andreijiroh@madebythepins.tk>
This commit is contained in:
parent
05581de822
commit
079b015052
|
@ -7,5 +7,4 @@ elif [[ $@ == "" ]]; then
|
|||
echo "==> Adding all of your SSH keys..."
|
||||
ssh-add ~/.ssh/github-personal
|
||||
ssh-add ~/.ssh/launchpad
|
||||
else
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/sh
|
||||
# copied from Termux app.
|
||||
# source-ssh-agent: Script to source for ssh-agent to work.
|
||||
|
||||
# Check if accidentaly executed instead of sourced:
|
||||
if echo "$0" | grep -q source-ssh-agent; then
|
||||
echo "source-ssh-agent: Do not execute directly - source me instead!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if echo $OSTYPE | grep -qE "^linux-android.*"; then
|
||||
export SSH_AUTH_SOCK=$PREFIX/tmp/ssh-agent
|
||||
else
|
||||
mkdir ~/.local>> /dev/null
|
||||
export SSH_AUTH_SOCK="$HOME/.local/ssh-agent"
|
||||
fi
|
||||
|
||||
start_agent() {
|
||||
rm -f $SSH_AUTH_SOCK
|
||||
eval $(ssh-agent -a $SSH_AUTH_SOCK -s)> /dev/null
|
||||
ssh-add
|
||||
}
|
||||
|
||||
MESSAGE=$(ssh-add -L 2>&1)
|
||||
if [ "$MESSAGE" = 'Could not open a connection to your authentication agent.' -o \
|
||||
"$MESSAGE" = 'Error connecting to agent: Connection refused' -o \
|
||||
"$MESSAGE" = 'Error connecting to agent: No such file or directory' ]; then
|
||||
start_agent
|
||||
elif [ "$MESSAGE" = "The agent has no identities." ]; then
|
||||
ssh-add
|
||||
fi
|
|
@ -20,16 +20,20 @@ else
|
|||
echo "⚠ Proceeding, please don't expect if things go brrr..."
|
||||
fi
|
||||
|
||||
if [[ $PWD != $HOME ]]; then
|
||||
echo "This script only works if you're in the home directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if echo $OSTYPE | grep linux-android.*; then
|
||||
# Assuming that you ibstalled wget and curl
|
||||
echo "==> Installing dependencies..."
|
||||
pkg install man git nano gnupg openssh python nodejs
|
||||
pkg install man git nano gnupg openssh python nodejs proot resolv-conf
|
||||
|
||||
# Clone our stuff
|
||||
echo "==> Cloning the dotfiles repo"
|
||||
git clone https://github.com/AndreiJirohHaliliDev2006/.dotfiles.git
|
||||
cd .dotfiles && git clone https://$GH_USERNAME:$GH_PAT@gitlab.com/AndreiJirohHaliliDev2006/dotfiles-secrets secrets
|
||||
chmod 600 secrets
|
||||
cd .dotfiles && git clone https://$GH_USERNAME:$GH_PAT@gitlab.com/AndreiJirohHaliliDev2006/dotfiles-secrets secrets && cd ~ && chmod 600 .dotfiles/secrets
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
echo "❌ That kinda sus, but only Andrei Jiroh can proceed!"
|
||||
|
@ -37,20 +41,26 @@ if echo $OSTYPE | grep linux-android.*; then
|
|||
fi
|
||||
|
||||
# Importing our SSH keys
|
||||
echo "==> Importing SSH keys..."
|
||||
mkdir ~/.ssh || echo "warning: ~/.ssh exists!"
|
||||
cp secrets/ssh/github-personal ~/.ssh/github-personal
|
||||
cp secrets/ssh/github-personal.pub ~/.ssh/github-personal.pub
|
||||
chmod 600 ~/*ssh/github-personal
|
||||
echo "==> Checking if ~/.ssh exists..."
|
||||
mkdir ~/.ssh && echo "We made that directory for you." || echo "warning: ~/.ssh exists!"
|
||||
echo "==> Copying SSH keys"
|
||||
cp .dotfiles/secrets/ssh/github-personal ~/.ssh/github-personal
|
||||
cp .dotfiles/secrets/ssh/github-personal.pub ~/.ssh/github-personal.pub
|
||||
cp .dotfiles/secrets/ssh/launchpad ~/.ssh/launchpad
|
||||
cp .dotfiles/secrets/ssh/launchpad.pub ~/.ssh/launchpad.pub
|
||||
chmod 600 ~/.ssh/launchpad
|
||||
chmod 600 ~/.ssh/github-personal
|
||||
echo "==> Generating OpenSSH client config..."
|
||||
./.dotfiles/bin/generate-ssh-config --client
|
||||
|
||||
# Link softly
|
||||
echo "==> Creating soft links for .bashrc and .gitconfig"
|
||||
ln -s termux.bashrc ~/.bashrc
|
||||
ln -s termux.gitconfig ~/.gitconfig
|
||||
ln -s .dotfiles/termux.bashrc ~/.bashrc
|
||||
ln -s .dotfiles/termux.gitconfig ~/.gitconfig
|
||||
|
||||
echo "✔ Task completed. Now, you need to manually import your"
|
||||
echo " PGP keys with the included import-pgp-keys script."
|
||||
elif echo $OSTYPE | grep linux-gnu.* && ;then
|
||||
else
|
||||
echo "Todo"
|
||||
echo "Script unsupported in this machine. See the online README for help."
|
||||
fi
|
||||
|
|
|
@ -13,7 +13,7 @@ else
|
|||
# not needed this because we have .ssh/config
|
||||
# but keep this uncommented because Git is being
|
||||
# an dougebag in every single shell sessiob.
|
||||
eval $(ssh-agent -s)
|
||||
source ~/.dotfiles/bin/source-ssh-agent
|
||||
fi
|
||||
|
||||
# Run this with add-ssh-keys instead
|
||||
|
|
Loading…
Reference in New Issue