set remote dir as a temp dir in order to handle multiple sessions

dev
totem4 3 years ago
parent 999ab1cc56
commit 353bd55d6c

@ -1 +1 @@
DSTDIR=/tmp/mstagliano_conf.d
DSTPREFIX=mstagliano

@ -5,21 +5,20 @@ set -eu
CURDIR=$(dirname $(readlink "$0"))
CONFHOME="~/.local/share/jssh/conf.d"
CONFALLBACK="$CURDIR/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
[[ -f $CURDIR/sshrc.conf ]] && source $CURDIR/sshrc.conf
DSTPREFIX=jssh
TARGET=$1
[[ -f $CURDIR/sshrc.conf ]] && source $CURDIR/sshrc.conf
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; }
COMMANDS="
export JSSHHOME=$'"$DSTDIR"';
mkdir \$JSSHHOME;
export JSSHHOME=\$(mktemp -d /tmp/$'"${DSTPREFIX}"'.XXXXXXXXXX);
echo $'"$arc"' | base64 -di | tar -xzf - -C \$JSSHHOME;
trap \"rm -rf \$JSSHHOME; exit\" 0;
bash --rcfile \$JSSHHOME/bashrc -i

Loading…
Cancel
Save