diff --git a/bin/bin/add-sshkey b/bin/bin/add-sshkey new file mode 100644 index 0000000..a121043 --- /dev/null +++ b/bin/bin/add-sshkey @@ -0,0 +1,14 @@ +#!/bin/bash + +TIMEOUT="1h" +NAME=$1 + +if [ -z "$NAME" ]; then + ssh-add -L +else + if [ -f "~/.ssh/id_ed25519_${NAME}" ]; then + ssh-add -t $TIMEOUT "~/.ssh/id_ed25519_${NAME}" + else + echo "No key named ${NAME} found..." + fi +fi \ No newline at end of file diff --git a/posh/Microsoft.PowerShell_profile.ps1 b/posh/Microsoft.PowerShell_profile.ps1 index a5d478b..a743af7 100644 --- a/posh/Microsoft.PowerShell_profile.ps1 +++ b/posh/Microsoft.PowerShell_profile.ps1 @@ -1,5 +1,5 @@ # Add a SSH key to SSH-Agent -function Add-Key { +function Add-SshKey { if ($args.Count -gt 0) { $filename = "$ENV:USERPROFILE\.ssh\id_ed25519_" + $args[0] if (!(Test-Path $filename -PathType Leaf)) {