infra/init.sh
2024-10-26 05:03:58 +02:00

37 lines
777 B
Bash

#!/bin/sh
echo "> Importing signer"
gpg --import signer.pub
gpg --edit-key tudbut@tudbut.de "trust" "quit"
echo done
echo "> Setting up peers"
echo -n "This node: TudbuT.infra."
read name
echo "TudbuT.infra.$name" > name.local
echo -n "Router is TudbuT.infra.router.main? [Y/n] "
read yn
if [ "$yn" != "n" ] ; then
echo "TudbuT.infra.router.main" > router.local
else
echo -n "Router: TudbuT.infra."
read router
echo "TudbuT.infra.$router" > router.local
fi
echo -n "Router lives at domain: "
read domain
echo "$domain" > router.ip.local
echo "All set."
echo "> Setting up GPG"
gpg --gen-key
echo "Please sign:"
gpg --export -a "TudbuT.infra.$name"
echo -n "Enter to confirm"
read
echo "Please give me the signed key:"
gpg --import
echo "Thank you!"
echo "> Done."