change names and location of rc scripts
This commit is contained in:
@ -9,4 +9,4 @@ pathadd ~/bin
|
|||||||
pathadd ~/.local/bin
|
pathadd ~/.local/bin
|
||||||
pathadd ~/frappy/bin
|
pathadd ~/frappy/bin
|
||||||
|
|
||||||
. ~/.bash_samenv
|
. ~/.config/linse_profile
|
||||||
|
@ -1,14 +1,9 @@
|
|||||||
alias dir='ls -alF'
|
alias dir='ls -alF'
|
||||||
export EDITOR=nano
|
export EDITOR=nano
|
||||||
|
|
||||||
if [ ! -f "~/.config/setuser/setuser.sh" ]; then
|
. ~/.config/linse_setuser
|
||||||
mkdir -p .config
|
|
||||||
scp -q -r -o BatchMode=yes -o StrictHostKeyChecking=no l_samenv@linse-c:.config/setuser ~/.config/
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f ~/.config/setuser/setuser.sh ]; then
|
export GIT_AUTHOR_NAME=PREVENT_DEFAULT
|
||||||
. ~/.config/setuser/setuser.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
function gitea_git() (
|
function gitea_git() (
|
||||||
for repo in "$@"; do
|
for repo in "$@"; do
|
44
to_system/home/l_samenv/.config/linse_setuser
Normal file
44
to_system/home/l_samenv/.config/linse_setuser
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
function setuser() {
|
||||||
|
if [[ $# -eq 0 ]]; then
|
||||||
|
cat << EOF
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
setuser <personal linux username>
|
||||||
|
|
||||||
|
set author for git commit and get gitea token from linse-c if available
|
||||||
|
|
||||||
|
EOF
|
||||||
|
if [[ ! -z "$LC_IDENTIFICATION" ]]; then
|
||||||
|
local id=($LC_IDENTIFICATION)
|
||||||
|
echo "you are already identified as ${id[@]:2:9} <${id[1]}>"
|
||||||
|
echo " "
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
local isuser=$(ssh l_samenv@linse-c "test -d ~$1 && echo OK" 2>/dev/null)
|
||||||
|
if [[ "$isuser" == "OK" ]]; then
|
||||||
|
local id=($LC_IDENTIFICATION)
|
||||||
|
echo " "
|
||||||
|
if [[ ! -z "$id" ]]; then
|
||||||
|
echo "you are already identified as: ${id[@]:2:9} <${id[1]}> - you may press ctrl-c to abort"
|
||||||
|
fi
|
||||||
|
echo "get token from $1@linse-c"
|
||||||
|
export LC_IDENTIFICATION=$(ssh $1@linse-c 'echo $LC_IDENTIFICATION' 2>/dev/null)
|
||||||
|
if [[ -z "$LC_IDENTIFICATION" ]]; then
|
||||||
|
echo "LC_IDENTIFICATION is not defined in your rc file on $1@linse-c"
|
||||||
|
else
|
||||||
|
local id=($LC_IDENTIFICATION)
|
||||||
|
echo "you are identified as ${id[@]:2:9} <${id[1]}>"
|
||||||
|
fi
|
||||||
|
echo " "
|
||||||
|
else
|
||||||
|
host=($(hostname -A))
|
||||||
|
export GIT_AUTHOR_NAME="$1"
|
||||||
|
export GIT_AUTHOR_EMAIL="$1@$host"
|
||||||
|
echo " "
|
||||||
|
echo "$1 is no valid linux user on linse-c -> not gitea token available for git push"
|
||||||
|
echo " "
|
||||||
|
echo "however, you are identified as $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> for git commit"
|
||||||
|
echo " "
|
||||||
|
fi
|
||||||
|
}
|
Reference in New Issue
Block a user