mirror of
https://github.com/danhper/fish-ssh-agent.git
synced 2025-12-13 17:34:59 +00:00
Restructurize and update readme.
This commit is contained in:
32
README.md
32
README.md
@@ -4,24 +4,24 @@ Utility functions to start your ssh agent when using fish shell.
|
|||||||
You will only need to run `ssh-add` and type your password once,
|
You will only need to run `ssh-add` and type your password once,
|
||||||
after the running ssh_agent should do the work for you.
|
after the running ssh_agent should do the work for you.
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```fish
|
||||||
|
fish-ssh-agent
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### Using [fundle](https://github.com/tuvistavie/fundle) (recommended)
|
```fish
|
||||||
|
git clone https://.../fish-ssh-agent
|
||||||
Add
|
source fish-ssh-agent/install.fish
|
||||||
|
|
||||||
```
|
|
||||||
fundle plugin 'tuvistavie/fish-ssh-agent'
|
|
||||||
```
|
```
|
||||||
|
|
||||||
to your `config.fish`, reload your shell and run `fundle install`.
|
or
|
||||||
|
|
||||||
### Using [Fisherman](https://github.com/fisherman/fisherman)
|
```sh
|
||||||
|
git clone https://.../fish-ssh-agent
|
||||||
fisher install tuvistavie/fish-ssh-agent
|
cp fish-ssh-agent/functions/* ~/.config/fish/functions
|
||||||
|
```
|
||||||
|
|
||||||
### Manually
|
|
||||||
|
|
||||||
Put `functions/__ssh_agent_start` your `~/.config/fish/functions` directory,
|
|
||||||
and source `init.fish` on startup.
|
|
||||||
|
|||||||
@@ -8,5 +8,6 @@ function __ssh_agent_is_started -d "check if ssh agent is already started"
|
|||||||
end
|
end
|
||||||
|
|
||||||
ps -ef | grep $SSH_AGENT_PID | grep -v grep | grep -q ssh-agent
|
ps -ef | grep $SSH_AGENT_PID | grep -v grep | grep -q ssh-agent
|
||||||
|
#pgrep ssh-agent
|
||||||
return $status
|
return $status
|
||||||
end
|
end
|
||||||
|
|||||||
9
functions/fish-ssh-agent.fish
Normal file
9
functions/fish-ssh-agent.fish
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
function fish-ssh-agent --description "Start ssh-agent if not started yet, or uses already started ssh-agent."
|
||||||
|
if test -z "$SSH_ENV"
|
||||||
|
set -xg SSH_ENV $HOME/.ssh/environment
|
||||||
|
end
|
||||||
|
|
||||||
|
if not __ssh_agent_is_started
|
||||||
|
__ssh_agent_start
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
if test -z "$SSH_ENV"
|
|
||||||
set -xg SSH_ENV $HOME/.ssh/environment
|
|
||||||
end
|
|
||||||
|
|
||||||
if not __ssh_agent_is_started
|
|
||||||
__ssh_agent_start
|
|
||||||
end
|
|
||||||
3
install.fish
Normal file
3
install.fish
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
source functions/*
|
||||||
|
funcsave __ssh_agent_is_started __ssh_agent_start fish-ssh-agent
|
||||||
Reference in New Issue
Block a user