Added colour to warning. Removed 'tput set AF' colour codes.
This commit is contained in:
parent
dae5b0fdaa
commit
6b794373f2
2 changed files with 8 additions and 8 deletions
12
.bashrc
12
.bashrc
|
|
@ -17,7 +17,7 @@ _agent_prompt_command() {
|
|||
echo "Connected to alternate ssh-agent - you may need to re-add keys."
|
||||
_SSH_AGENT_REG_FAILED=0
|
||||
else
|
||||
echo "Connected to, but failed to register, alternate ssh-agent - you may need to re-add keys."
|
||||
echo "$(tput setaf 3)Connected to, but failed to register, alternate ssh-agent - you may need to re-add keys.$(tput op)"
|
||||
_SSH_AGENT_REG_FAILED=1
|
||||
fi
|
||||
}
|
||||
|
|
@ -26,13 +26,13 @@ _agent_prompt_command() {
|
|||
else
|
||||
if [[ -z "$(egrep -v '^$' ~/.ssh/agents)" ]]; then
|
||||
((${_SSH_PROMPT_ERROR_ISSUED:-0} == 0)) && {
|
||||
echo "$(tput setaf 1 || tput AF 1)Lost connection to ssh-agent - no alternate available!$(tput op)"
|
||||
echo "$(tput setaf 1)Lost connection to ssh-agent - no alternate available!$(tput op)"
|
||||
unset SSH_AUTH_SOCK
|
||||
_SSH_PROMPT_ERROR_ISSUED=1
|
||||
}
|
||||
else
|
||||
((${_SSH_PROMPT_ERROR_ISSUED:-0} == 0)) && {
|
||||
echo "$(tput setaf 1 || tput AF 1)Lost connection to ssh-agent - failed to connect to new agent!$(tput op)"
|
||||
echo "$(tput setaf 1)Lost connection to ssh-agent - failed to connect to new agent!$(tput op)"
|
||||
unset SSH_AUTH_SOCK
|
||||
_SSH_PROMPT_ERROR_ISSUED=1
|
||||
}
|
||||
|
|
@ -84,7 +84,7 @@ _lock_agents_file() {
|
|||
if exec 9>~/.ssh/agents.lock && flock -E 10 -w 0.5 9; then
|
||||
return 0
|
||||
else
|
||||
echo "$(tput setaf 1 || tput AF 1)Failed to obtain lockfile!$(tput op)"
|
||||
echo "$(tput setaf 1)Failed to obtain lockfile!$(tput op)"
|
||||
fi
|
||||
elif [[ "$_PLATFORM" == "Darwin" ]]; then
|
||||
# Do locking the sucky way on OSX.
|
||||
|
|
@ -95,9 +95,9 @@ _lock_agents_file() {
|
|||
sleep 0.1
|
||||
fi
|
||||
done
|
||||
[[ "${_GOT_LOCK:-0}" == "0" ]] && echo "$(tput setaf 1 || tput AF 1)Failed to obtain lockfile!$(tput op)"
|
||||
[[ "${_GOT_LOCK:-0}" == "0" ]] && echo "$(tput setaf 1)Failed to obtain lockfile!$(tput op)"
|
||||
else
|
||||
echo "$(tput setaf 1 || tput AF 1)File locking unsupported - skipping update of agents file!$(tput op)"
|
||||
echo "$(tput setaf 1)File locking unsupported - skipping update of agents file!$(tput op)"
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue