ma retiolum: temporarily add helper script for retioum

This commit is contained in:
makefu 2022-06-06 21:34:02 +02:00
parent 6087a17922
commit ffdb73bed5
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225

View File

@ -0,0 +1,19 @@
#!/bin/sh
for i in *.pub;do
sleep 1
host=${i%%.pub}
if test -e "${host}_ed25519.pub" ;then
echo "ed25519 key already exits"
else
tmpdir=$(mktemp --tmpdir -d create-retiolum-ed25519-keys.XXXXXXXX)
trap 'rm -vR "$tmpdir"' EXIT
tinc --batch --config "$tmpdir" generate-ed25519-keys
cp -v "$tmpdir/ed25519_key.pub" "${host}_ed25519.pub"
cat "$tmpdir/ed25519_key.priv" | secrets insert -m "$host/retiolum.ed25519_key.priv"
rm -vR "$tmpdir"
fi
done