summaryrefslogtreecommitdiff
path: root/zshfunc
diff options
context:
space:
mode:
Diffstat (limited to 'zshfunc')
-rw-r--r--zshfunc/safe-restore-ssh-agent-socket11
-rw-r--r--zshfunc/setup-oftc-aliases9
2 files changed, 20 insertions, 0 deletions
diff --git a/zshfunc/safe-restore-ssh-agent-socket b/zshfunc/safe-restore-ssh-agent-socket
new file mode 100644
index 0000000..f4b9751
--- /dev/null
+++ b/zshfunc/safe-restore-ssh-agent-socket
@@ -0,0 +1,11 @@
+## vim:ft=zsh:foldmethod=marker
+
+if [ "$SSH_AUTH_SOCK" != "" ] && [ "$SSH_AUTH_SOCK" != "$HOME/.ssh-auth-sock" ] ; then
+ if ! [ -e "$HOME/.ssh-auth-sock" ] || [ "`readlink $HOME/.ssh-auth-sock`" != "$SSH_AUTH_SOCK" ]; then
+ echo "Setting ~/.ssh-auth-sock."
+ rm -f "$HOME/.ssh-auth-sock"
+ ln -s "$SSH_AUTH_SOCK" "$HOME/.ssh-auth-sock"
+ fi
+elif [ "$SSH_AUTH_SOCK" = "" ] && [ -e "$HOME/.ssh-auth-sock" ]; then
+ SSH_AUTH_SOCK="$HOME/.ssh-auth-sock"; export SSH_AUTH_SOCK
+fi
diff --git a/zshfunc/setup-oftc-aliases b/zshfunc/setup-oftc-aliases
new file mode 100644
index 0000000..d7c310e
--- /dev/null
+++ b/zshfunc/setup-oftc-aliases
@@ -0,0 +1,9 @@
+## vim:ft=zsh:foldmethod=marker
+
+cat "$HOME/.oftc-hosts" | while read name ip; do
+ alias -g $name-ip="$ip"
+ alias irssi-$name="irssi --home=$HOME/.irssi-MASTER --connect=OFTC-$name"
+
+ alias -g $name-testnet-ip="$ip"
+ alias irssi-testnet-$name="irssi --home=$HOME/.irssi-MASTER --connect=TESTNET-$name"
+done