#!/bin/sh # post_bootstrap.sh - Setup SSH, GPG, and pull private repositories after initial Ansible bootstrap. set -e echo "[*] Starting post-bootstrap setup..." # Start ssh-agent and add your SSH key if [ -f "$HOME/.ssh/id_ed25519" ]; then echo "[*] Starting ssh-agent..." eval "$(ssh-agent -s)" ssh-add "$HOME/.ssh/id_ed25519" else echo "[!] No SSH private key found at ~/.ssh/id_ed25519. Skipping ssh-add." fi # Launch GPG agent echo "[*] Launching gpg-agent..." gpgconf --launch gpg-agent # Clone gopass store if not already present if [ ! -d "$HOME/.local/share/gopass/stores/root/.git" ]; then echo "[*] Cloning gopass password store..." mkdir -p "$HOME/.local/share/gopass/stores" git clone git@yourgit:gopass-store.git "$HOME/.local/share/gopass/stores/root" gopass fsck gopass sync else echo "[*] Gopass store already exists. Skipping clone." fi # Clone bookmarks repo if not already present if [ ! -d "$HOME/bookmarks/.git" ]; then echo "[*] Cloning bookmarks repository..." git clone git@yourgit:bookmarks.git "$HOME/bookmarks" else echo "[*] Bookmarks repo already exists. Skipping clone." fi # Git global config (safe to rerun, idempotent) echo "[*] Setting git global defaults..." git config --global init.defaultBranch master git config --global pull.rebase false echo "[*] Post-bootstrap setup complete."