This commit is contained in:
jay 2024-03-30 22:41:35 +08:00
parent 95ad4c7c5f
commit 50c21d3233
3 changed files with 8 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 MiB

After

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 MiB

View File

@ -2,6 +2,14 @@
# `$HOME/bin/start-agent` # `$HOME/bin/start-agent`
SSH_ENV="$HOME/.ssh/agent-environment" SSH_ENV="$HOME/.ssh/agent-environment"
function escapeStr {
if [ -z "$1" ]; then
echo "usage: escapeStr <string>"
return 1
fi
echo $1 | sed -r 's/([\$"])/\\\1/g'
}
function start_agent { function start_agent {
echo "Initialising new SSH agent..." echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"