dotfiles v1.1.11

This commit is contained in:
2026-06-27 00:09:46 +00:00
parent 5b09d61975
commit 5d2e966214
4 changed files with 111 additions and 25 deletions

View File

@@ -31,10 +31,12 @@ function keyme -d "Generate (or regenerate) an ed25519 SSH key for Gitea and con
# If an IdentityFile line already exists under this Host, replace it;
# otherwise add one after the HostName line.
if grep -A5 "^Host $host\$" "$config_path" | grep -q "IdentityFile"
sed -i "/^Host $host\$/,/^Host /s|IdentityFile .*|IdentityFile $key_path|" "$config_path"
sed -i.bak "/^Host $host\$/,/^Host /s|IdentityFile .*|IdentityFile $key_path|" "$config_path"
command rm -f "$config_path.bak"
echo "Updated IdentityFile for Host $host in $config_path"
else
sed -i "/^Host $host\$/,/^Host /s|HostName .*|&\n\tIdentityFile $key_path|" "$config_path"
sed -i.bak "/^Host $host\$/,/^Host /s|HostName .*|&\n\tIdentityFile $key_path|" "$config_path"
command rm -f "$config_path.bak"
echo "Added IdentityFile for Host $host in $config_path"
end
else