commit by to_remotes 2023-10-05 09:27:39 +0200 from vmdevac
parent
7d91d1c7ea
commit
8925fc1852
16
init.sh
16
init.sh
|
|
@ -38,13 +38,8 @@ function clone_repo_with_retry(){
|
|||
}
|
||||
|
||||
|
||||
|
||||
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() {
|
||||
# Oh-my-zsh compatible bash ssh-agent start script
|
||||
function _start_agent() {
|
||||
if [[ -f "$ssh_env_cache" ]]; then
|
||||
. "$ssh_env_cache" > /dev/null
|
||||
fi
|
||||
|
|
@ -57,7 +52,12 @@ function start_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"
|
||||
|
||||
_start_agent
|
||||
|
||||
unset ssh_env_cache
|
||||
|
|
|
|||
Loading…
Reference in New Issue