remove ssh from profile

This commit is contained in:
flo 2025-01-04 04:30:13 +01:00
parent 630aece11c
commit 6d704846d3
3 changed files with 32 additions and 36 deletions

View File

@ -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\]\$ '

View File

@ -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
View 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