Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
*.app
*.bak
*.desktop
*.exe
*.log
.*.swp
.DS_Store
Expand All @@ -12,8 +15,5 @@ man
opt
pino
share/mutt/mail*
think*
*.desktop
*.app
*.exe
share/vim/systags
think*
2 changes: 1 addition & 1 deletion scripts/update-host
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ sub _do_submodules
if ($? != 0)
{
print STDERR ("Failed to update git submodules. Please run:\n");
print STDERR ("cd $ENV{'HOME'}/Applications && git submodule update --remote --merge\n");
print STDERR ("cd $ENV{'HOME'}/Applications && git submodule update --init --remote --merge\n");
_exit_safe(1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion share/shell/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ alias vcl='git logline'
alias vcf='git fsck'
alias vcg='git gc' # --prune is wrong as default
alias vct='git tag'
alias vcy='git submodule update --remote --merge' # download/fetch submodule changes, merge those changes into my repository
alias vcy='git submodule update --init --remote --merge' # download/fetch submodule changes, merge those changes into my repository

alias diff='diff -burN'

Expand Down
44 changes: 30 additions & 14 deletions share/shell/ssh-agent-setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
# Luis Mondesi <lmondesi@bloomberg.net>
# 2012-07-30
#
# Note that this script should run on all sh-like shells,
# not only bash.
# Source this script to start an ssh-agent and load your keys, typically at login
#
# . ssh-agent-setup # from ~/.profile
#
# License: GPL
# CHANGES:
# 2025-09-05 - make it quieter. Use DEBUG env var for debug output
# 2025-05-22 - add support for ssh-agent
# 2022-10-20 - simplify loading keys
# 2022-05-24 - adds logic to support Darwin

echo "# running $0 (~/.ssh-agent-setup.bash)"
if [[ $DEBUG ]]; then
echo "# running $0 (~/.ssh-agent-setup.bash)"
fi

ENV_FILE="$HOME/.ssh-agent.env"

Expand All @@ -23,23 +25,33 @@ clean_old_sock() {
}

launch_agent() {
echo "# launching new ssh-agent"
if [[ $DEBUG ]]; then
echo "# launching new ssh-agent"
fi
ssh-agent -s > "$ENV_FILE"
source "$ENV_FILE" >/dev/null
echo "# ssh-agent started and environment saved to $ENV_FILE"
if [[ $DEBUG ]]; then
echo "# ssh-agent started and environment saved to $ENV_FILE"
fi
}

load_agent() {
if [ -f "$ENV_FILE" ]; then
echo "# loading ssh-agent from $ENV_FILE"
source "$ENV_FILE"
if [[ -f "$ENV_FILE" ]]; then
if [[ $DEBUG ]]; then
echo "# loading ssh-agent from $ENV_FILE"
fi
source "$ENV_FILE" >/dev/null
if ! ssh-add -l > /dev/null 2>&1; then
echo "# agent not responding, launching new one"
if [[ $DEBUG ]]; then
echo "# agent not responding, launching new one"
fi
clean_old_sock
launch_agent
fi
else
echo "# no existing agent, launching new one"
if [[ $DEBUG ]]; then
echo "# no existing agent, launching new one"
fi
launch_agent
fi
}
Expand All @@ -50,19 +62,23 @@ add_keys() {
! -name '*.pub' | while read -r key; do

if ssh-add -l 2>/dev/null | grep -q "$key"; then
echo "# Key $key already loaded"
if [[ $DEBUG ]]; then
echo "# Key $key already loaded"
fi
continue
fi

echo "# Loading key $key"
if [[ $DEBUG ]]; then
echo "# Loading key $key"
fi
ssh-add "$key"
rc=$?
if [ "$rc" = 2 ]; then
if [[ "$rc" == 2 ]]; then
echo "# Repairing ssh-agent ($rc)"
clean_old_sock
launch_agent
ssh-add "$key"
elif [ "$rc" = 1 ]; then
elif [[ "$rc" == 1 ]]; then
echo "# Your key $key could not be loaded"
fi
done
Expand Down