clean up script
This commit is contained in:
34
install.sh
34
install.sh
@@ -1,37 +1,47 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
# install basic packages
|
if [ ! -f /etc/alpine-release ]; then
|
||||||
|
echo "Error: This script only runs on Alpine Linux."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Installing packages..."
|
||||||
apk add gnupg gnupg-scdaemon pinentry-tty git
|
apk add gnupg gnupg-scdaemon pinentry-tty git
|
||||||
|
|
||||||
# gnupg config
|
echo "Configuring GPG..."
|
||||||
mkdir -p ~/.gnupg
|
mkdir -p ~/.gnupg
|
||||||
chmod -R 700 ~/.gnupg
|
chmod -R 700 ~/.gnupg
|
||||||
echo 'enable-ssh-support' > ~/.gnupg/gpg-agent.conf
|
echo 'enable-ssh-support' > ~/.gnupg/gpg-agent.conf
|
||||||
echo 'pinentry-program /usr/bin/pinentry-tty' >> ~/.gnupg/gpg-agent.conf
|
echo 'pinentry-program /usr/bin/pinentry-tty' >> ~/.gnupg/gpg-agent.conf
|
||||||
|
|
||||||
# setup env
|
echo "Setting up environment..."
|
||||||
export GPG_TTY="$(tty)"
|
export GPG_TTY="$(tty)"
|
||||||
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
|
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
|
||||||
|
|
||||||
# trust key on card
|
echo "Importing and trusting GPG key..."
|
||||||
gpg --recv-keys "56FB101D4E094804B1666859083A2C9A046554D6"
|
gpg --recv-keys "56FB101D4E094804B1666859083A2C9A046554D6"
|
||||||
echo "56FB101D4E094804B1666859083A2C9A046554D6:6:" | gpg --import-ownertrust
|
echo "56FB101D4E094804B1666859083A2C9A046554D6:6:" | gpg --import-ownertrust
|
||||||
|
|
||||||
# restart agent
|
echo "Restarting GPG agent..."
|
||||||
gpgconf --kill gpg-agent
|
gpgconf --kill gpg-agent
|
||||||
gpg-agent --daemon
|
gpg-agent --daemon
|
||||||
|
|
||||||
# test
|
echo "Testing SSH connection..."
|
||||||
ssh -T git@g.eliaskohout.de
|
ssh -T git@g.eliaskohout.de || true
|
||||||
|
|
||||||
# setup projects
|
echo "Setting up projects directory..."
|
||||||
mkdir ~/projects/
|
mkdir -p ~/projects
|
||||||
cd ~/projects/
|
cd ~/projects
|
||||||
git clone "git@g.eliaskohout.de:eliaskohout/env.git"
|
git clone "git@g.eliaskohout.de:eliaskohout/env.git"
|
||||||
|
|
||||||
# setup env
|
echo "Adding community repository..."
|
||||||
grep main /etc/apk/repositories | sed 's/main/community/' >> /etc/apk/repositories
|
grep main /etc/apk/repositories | sed 's/main/community/' >> /etc/apk/repositories
|
||||||
apk update
|
apk update
|
||||||
|
|
||||||
|
echo "Running env setup..."
|
||||||
cd env
|
cd env
|
||||||
./runs/up.python.sh
|
./runs/up.python.sh
|
||||||
./scripts/conf-run up
|
./scripts/conf-run up
|
||||||
|
|
||||||
|
echo "Setup complete!"
|
||||||
|
|||||||
Reference in New Issue
Block a user