From 336a58a1a50637e75c062321d3f9c6790de6e6aa Mon Sep 17 00:00:00 2001 From: totem4 Date: Wed, 27 Oct 2021 23:48:37 +0200 Subject: [PATCH] added path of global conf file --- sshrc.conf | 2 +- sshrc.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sshrc.conf b/sshrc.conf index 8e88fbe..4c1930e 100644 --- a/sshrc.conf +++ b/sshrc.conf @@ -1 +1 @@ -DSTPREFIX=mstagliano +DSTPREFIX=pippo diff --git a/sshrc.sh b/sshrc.sh index 8449f31..a22ef69 100755 --- a/sshrc.sh +++ b/sshrc.sh @@ -3,7 +3,8 @@ set -eu CURDIR=$(dirname $(readlink "$0")) -CONFHOME="~/.local/share/jssh/conf.d" +CONFLOCAL="~/.local/share/jssh" +CONFHOME="$CONFLOCAL/conf.d" CONFALLBACK="$CURDIR/conf.d" [[ -d $CONFHOME ]] && CONFDIR=$CONFHOME || CONFDIR=$CONFALLBACK @@ -12,7 +13,11 @@ CONFALLBACK="$CURDIR/conf.d" DSTPREFIX=jssh -[[ -f $CURDIR/sshrc.conf ]] && source $CURDIR/sshrc.conf +if [[ -r "$CONFLOCAL/sshrc.conf" ]]; then + source "$CONFLOCAL/sshrc.conf" +elif [[ -r "$CURDIR/sshrc.conf" ]]; then + source "$CURDIR/sshrc.conf" +fi arc=$(tar czf - -C $CONFDIR $(find $CONFDIR -type f -printf "%f ")| base64 -w0) [[ $(echo $arc | wc -c) -le 65535 ]] || { echo "Files size too large!"; exit 1; }