bitreich-drist

fork of bitreich.org/drist
git clone git://git.pyratebeard.net/bitreich-drist.git
Log | Files | Refs | README | LICENSE

commit 7c346ee39c6eb202a1851bca9ab1a8cbfb770573
parent 6cf99ed18454bf3a7533c638e354f0892daada1b
Author: parazyd <parazyd@dyne.org>
Date:   Fri,  7 Jun 2019 14:08:37 +0200

Use a relative path for remote_script().

This logic creates a temp file for remote_script() in the current
directory and also cleans it up after the ssh command has been executed.

Diffstat:
Mdrist | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drist b/drist @@ -73,11 +73,13 @@ remote_script() { printf 'Executing file "%s":\n' "$1" if [ "$SIMULATE" -ne 1 ] then - ssh $SSH_PARAMS "${2}" "DRIST=$(mktemp /tmp/drist.XXXXXXXXXXXX) && + dr="$(mktemp ./drist.XXXXXXXXXXXX)" + ssh $SSH_PARAMS "${2}" "DRIST=${dr} && cat - > \$DRIST && chmod u+x \$DRIST && ${EXEC} \$DRIST ; rm \$DRIST" < "$1" + rm "$dr" fi fi }