remove ssh from profile
This commit is contained in:
parent
630aece11c
commit
6d704846d3
44
.profile
44
.profile
@ -1,43 +1,17 @@
|
||||
# bin
|
||||
# system-aliasses
|
||||
if [ -f "$DEV_ENV_PATH/.aliases" ]; then
|
||||
. "$DEV_ENV_PATH/.aliases"
|
||||
fi
|
||||
|
||||
# binaries
|
||||
. $DEV_ENV_PATH/bin/denv
|
||||
. $DEV_ENV_PATH/bin/dcom
|
||||
. $DEV_ENV_PATH/bin/drun
|
||||
. $DEV_ENV_PATH/bin/git
|
||||
# /bin
|
||||
. $DEV_ENV_PATH/bin/ssh
|
||||
|
||||
# alias
|
||||
if [ -f "$DEV_ENV_PATH/.aliases" ]; then
|
||||
. "$DEV_ENV_PATH/.aliases"
|
||||
fi
|
||||
# /alias
|
||||
|
||||
# GIT branch in bash
|
||||
# git branch in shell
|
||||
parse_git_branch() {
|
||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
|
||||
}
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
|
||||
# /GIT branch in bash
|
||||
|
||||
|
||||
# SSH
|
||||
SSH_ENV="$HOME/.ssh/agent-environment"
|
||||
function start_agent {
|
||||
echo "Initialising new SSH agent..."
|
||||
/usr/bin/ssh-agent | sed 's/^echo/#echo/' >"$SSH_ENV"
|
||||
echo succeeded
|
||||
chmod 600 "$SSH_ENV"
|
||||
. "$SSH_ENV" >/dev/null
|
||||
/usr/bin/ssh-add;
|
||||
|
||||
ssh-add ~/.ssh/gitea_ssh
|
||||
}
|
||||
|
||||
if [ -f "$SSH_ENV" ]; then
|
||||
. "$SSH_ENV" >/dev/null
|
||||
ps -ef | grep $SSH_AGENT_PID | grep ssh-agent$ >/dev/null || {
|
||||
start_agent
|
||||
}
|
||||
else
|
||||
start_agent
|
||||
fi
|
||||
# /SSH
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
|
||||
@ -1,7 +1,7 @@
|
||||
# Systems configuration
|
||||
# configure the systems for the dev-env with the following pattern:
|
||||
#
|
||||
# <identifier>=<path/to/folder> <git repo link>
|
||||
# <identifier> <path/to/folder> <git repo link>
|
||||
#
|
||||
# LIKE CRON - THE FILE HAS TO END WITH AN EMPTY LINE
|
||||
#
|
||||
|
||||
22
bin/ssh
Normal file
22
bin/ssh
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
SSH_ENV="$HOME/.ssh/agent-environment"
|
||||
function dssh {
|
||||
echo "Initialising new SSH agent..."
|
||||
/usr/bin/ssh-agent | sed 's/^echo/#echo/' >"$SSH_ENV"
|
||||
echo succeeded
|
||||
chmod 600 "$SSH_ENV"
|
||||
. "$SSH_ENV" >/dev/null
|
||||
/usr/bin/ssh-add;
|
||||
|
||||
ssh-add ~/.ssh/gitea_ssh
|
||||
}
|
||||
|
||||
if [ -f "$SSH_ENV" ]; then
|
||||
. "$SSH_ENV" >/dev/null
|
||||
ps -ef | grep $SSH_AGENT_PID | grep ssh-agent$ >/dev/null || {
|
||||
dssh
|
||||
}
|
||||
else
|
||||
dssh
|
||||
fi
|
||||
Loading…
Reference in New Issue
Block a user