From 0ce4168dabf37740b523bbe04ab9e1eea7e8d13a Mon Sep 17 00:00:00 2001 From: totem4 Date: Thu, 21 Oct 2021 18:50:18 +0200 Subject: [PATCH] Added conffile path and fallback --- sshrc.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sshrc.sh b/sshrc.sh index fc16b09..628a75b 100755 --- a/sshrc.sh +++ b/sshrc.sh @@ -2,7 +2,10 @@ set -eu -CONFDIR=/home/totem4/Apps/my_script/sshrc/conf.d +CONFHOME="~/.local/share/jssh/conf.d" +CONFALLBACK="$(dirname $(readlink "$0"))/conf.d" +[[ -d $CONFHOME ]] && CONFDIR=$CONFHOME || CONFDIR=$CONFALLBACK + [[ -r $CONFDIR/bashrc ]] || { echo "Confdir or bashrc missing or lack of permissions!"; exit 1; } DSTDIR=/tmp/conf.d TARGET=$1