forked from cowboy/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path30_connection.sh
More file actions
executable file
·57 lines (52 loc) · 946 Bytes
/
30_connection.sh
File metadata and controls
executable file
·57 lines (52 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
check-ssh-add() {
# if [ "$DESKTOP_SESSION" == "" ] then # @todo comentei pq tava dando erro de parser no zsh
if [[ `ssh-add -l` != *id_?sa* ]] then
ssh-add -t 5h ## 5 hour ssh-agent expiration
fi
# fi
}
slogin() {
check-ssh-add
QUOTE_ARGS=''
for ARG in "$@"
do
QUOTE_ARGS="${QUOTE_ARGS} '${ARG}'"
done
eval /usr/bin/slogin ${QUOTE_ARGS}
}
ssh() {
check-ssh-add
QUOTE_ARGS=''
for ARG in "$@"
do
QUOTE_ARGS="${QUOTE_ARGS} '${ARG}'"
done
eval /usr/bin/ssh ${QUOTE_ARGS}
}
scp() {
check-ssh-add
QUOTE_ARGS=''
for ARG in "$@"
do
QUOTE_ARGS="${QUOTE_ARGS} '${ARG}'"
done
eval /usr/bin/scp ${QUOTE_ARGS}
}
sftp() {
check-ssh-add
QUOTE_ARGS=''
for ARG in "$@"
do
QUOTE_ARGS="${QUOTE_ARGS} '${ARG}'"
done
eval /usr/bin/sftp ${QUOTE_ARGS}
}
git() {
check-ssh-add
QUOTE_ARGS=''
for ARG in "$@"
do
QUOTE_ARGS="${QUOTE_ARGS} '${ARG}'"
done
eval /usr/bin/git ${QUOTE_ARGS}
}