#!/bin/bash # Extract the login details from enpass LABS=$(enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show "Scarif: Labs" 2>&1) LABSUN=$(echo "$LABS" | grep -Po "(?<=login: )\w+") LABSPW=$(echo "$LABS" | grep -Po "(?<=pass : ).+(?=\")") SSHPATH="$HOME/.ssh/id_ed25519" # The path to the SSH key file TITLE="$USER@$(cat /etc/hostname)" # The title for the SSH key # Generate the SSH key if it does not exist [ ! -f $SSHPATH ] && ssh-keygen -t ed25519 -f "$SSHPATH" -N "" -q KEY=$(cat "$SSHPATH.pub") # A method to generate the parameters for creating an SSH key on gitea generate_post_data() { cat <