commit 9444c6212cd7ea62cead2da2dc62b8bb8a420090 parent ad190a8c3a71b95baa8bab80688d6382cf399911 Author: pyratebeard <root@pyratebeard.net> Date: Wed, 8 May 2024 09:55:25 +0100 modification to make less interactive Diffstat:
M | forge | | | 22 | +++++++++++----------- |
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/forge b/forge @@ -24,36 +24,37 @@ function _echo() { printf "\n╓───── %s \n╙──────── exit 1 } +mkdir -p /run/forge + # ▓▓▒░ vault _echo "enter domain" -read DOMAIN - +[ $# -eq 1 ] && DOMAIN="tilde.gdn" || read DOMAIN echo "$(hostname -s).${DOMAIN}" > /etc/hostname # ▓▓▒░ locale _echo "setting up locales" locale-gen "en_US.UTF-8" localectl set-locale en_US.UTF-8 -dpkg-reconfigure locales +dpkg-reconfigure -f noninteractive locales systemctl daemon-reload # ▓▓▒░ packages _echo "installing runtime deps" -apt update && apt install -y ansible curl git sudo unzip +apt-get update && apt-get install -y ansible curl git sudo unzip # ▓▓▒░ install collection for bitwarden lookup ansible-galaxy collection install community.general # ▓▓▒░ bitwarden _echo "bitwarden setup" -curl -sL -o /tmp/bw.zip "https://vault.bitwarden.com/download/?app=cli&platform=linux" && \ - unzip -d /usr/local/bin /tmp/bw.zip -export BW_SESSION=$(bw login "${EMAIL}" --raw --method 0) +curl -sL -o /run/forge/bw.zip "https://vault.bitwarden.com/download/?app=cli&platform=linux" && \ + unzip -d /usr/local/bin /run/forge/bw.zip +export BW_SESSION=$(bw login --apikey) # ▓▓▒░ pull play _echo "cloning repo" -git clone git://git.pyratebeard.net/setup.git /tmp/setup && \ - cd /tmp/setup +git clone git://git.pyratebeard.net/setup.git /run/forge/setup && \ + pushd /run/forge/setup _echo "let's play" ansible-playbook playbook.yml @@ -66,10 +67,9 @@ echo "remote addr: $RIP" _echo "cleanup" bw logout -rm -rf /tmp/bw.zip &>/dev/null rm -rf /usr/local/bin/bw &>/dev/null srm -drvl /usr/dwarf/.config/Bitwarden\ CLI &>/dev/null srm -drvl /etc/ssh/hostca-* &>/dev/null -srm -dvrl /tmp/setup &>/dev/null +srm -dvrl /run/forge/ &>/dev/null srm -dvrl "$0" &>/dev/null reboot