Initial commit.
This commit is contained in:
commit
5aa699d465
|
@ -0,0 +1,22 @@
|
||||||
|
# fish-ssh-agent
|
||||||
|
|
||||||
|
Utility functions to start your ssh agent when using fish shell.
|
||||||
|
You will only need to run `ssh-add` and type your password once,
|
||||||
|
after the running ssh_agent should do the work for you.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### Using [fundle](https://github.com/tuvistavie/fundle) (recommended)
|
||||||
|
|
||||||
|
Add
|
||||||
|
|
||||||
|
```
|
||||||
|
fundle plugin 'tuvistavie/fish-ssh-agent'
|
||||||
|
```
|
||||||
|
|
||||||
|
to your `config.fish`, reload your shell and run `fundle install`.
|
||||||
|
|
||||||
|
### Manually
|
||||||
|
|
||||||
|
Put `functions/__ssh_agent_start` your `~/.config/fish/functions` directory,
|
||||||
|
and source `init.fish` on startup.
|
|
@ -0,0 +1,5 @@
|
||||||
|
function __ssh_agent_start
|
||||||
|
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
|
||||||
|
chmod 600 $SSH_ENV
|
||||||
|
source $SSH_ENV > /dev/null
|
||||||
|
end
|
|
@ -0,0 +1,13 @@
|
||||||
|
if test -z "$SSH_ENV"
|
||||||
|
setenv SSH_ENV $HOME/.ssh/environment
|
||||||
|
end
|
||||||
|
|
||||||
|
if test -z "$SSH_AGENT_PID"
|
||||||
|
if test -f $SSH_ENV
|
||||||
|
source $SSH_ENV > /dev/null
|
||||||
|
end
|
||||||
|
ps -ef | grep $SSH_AGENT_PID | grep -v grep | grep ssh-agent > /dev/null
|
||||||
|
if test $status -ne 0
|
||||||
|
__ssh_agent_start
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue