5
0
Fork 0

commit by to_remotes 2023-10-05 09:27:39 +0200 from vmdevac

main
ag 2023-10-05 09:27:39 +02:00
parent 7d91d1c7ea
commit 8925fc1852
1 changed files with 16 additions and 16 deletions

30
init.sh
View File

@ -38,26 +38,26 @@ function clone_repo_with_retry(){
}
# Oh-my-zsh compatible bash ssh-agent start script
function _start_agent() {
if [[ -f "$ssh_env_cache" ]]; then
. "$ssh_env_cache" > /dev/null
fi
if [[ -S "$SSH_AUTH_SOCK" ]]; then
return 0
fi
echo "Starting ssh-agent ..."
ssh-agent -s | sed '/^echo/d' > "$ssh_env_cache"
chmod 600 "$ssh_env_cache"
. "$ssh_env_cache" > /dev/null
}
function start_ssh_agent(){
SHORT_HOST="${HOSTNAME/.*/}"
ssh_env_cache="$HOME/.ssh/environment-$SHORT_HOST"
# Oh-my-zsh compatible bash ssh-agent start script
function _start_agent() {
if [[ -f "$ssh_env_cache" ]]; then
. "$ssh_env_cache" > /dev/null
fi
if [[ -S "$SSH_AUTH_SOCK" ]]; then
return 0
fi
echo "Starting ssh-agent ..."
ssh-agent -s | sed '/^echo/d' > "$ssh_env_cache"
chmod 600 "$ssh_env_cache"
. "$ssh_env_cache" > /dev/null
}
_start_agent
unset ssh_env_cache