Last active
May 29, 2025 15:44
-
-
Save volodymyr-mykhailyk/7c8bcf7ed49cc4c786cd0ce9bc46499b to your computer and use it in GitHub Desktop.
home-box bootstrap script
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
#!/bin/bash | |
set -e | |
BOOTSTRAP_LOCATION=/data/bootstrap | |
echo "Bootstrapping configuration in /data/bootstrap" | |
echo "Ensuring base folders available" | |
mkdir -p /boot/bootstrap | |
mkdir -p /data | |
if [ ! -e "${BOOTSTRAP_LOCATION}" ]; then | |
echo "Mounting bootstrap folder to unraid flash disk" | |
ln -sf "/boot/bootstrap" "${BOOTSTRAP_LOCATION}" | |
fi | |
cd /data/bootstrap | |
echo "Setting up ssh keys" | |
if [ ! -f ~/.ssh/id_rsa ]; then | |
echo "SSH key not found. Generating." | |
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -P "" | |
fi | |
if [ ! -d ./.git ]; then | |
echo "Cloning configs repo" | |
echo "Configure following ssh key on repository for access and decryption:" | |
cat ~/.ssh/id_rsa.pub | |
# shellcheck disable=SC2162 | |
read -p "Press enter to continue setup after you allowed this host to read from volodymyr-mykhailyk/home-box repo" | |
echo "Checking out full setup code" | |
git clone [email protected]:volodymyr-mykhailyk/home-box.git . | |
fi | |
echo "Running full setup" | |
bash setup/run.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
bash <(curl -s https://gist.githubusercontent.com/volodymyr-mykhailyk/7c8bcf7ed49cc4c786cd0ce9bc46499b/raw/4dc82d2b23d98f27d7940e56919b37a308c7ac9e/home-box-bootstrap.sh)