logo

sshpaste

Simple paste script to a server having SSH+HTTP daemons
commit: 127381f2165c27d4a0e695a4a259eeec366b0e55
parent: ecc99b4d6b821d1d9e6d36cdba1fc90f622beb7a
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon, 30 Apr 2018 00:53:50 +0200

sshpaste: Fix test expressions

Diffstat:

Msshpaste4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sshpaste b/sshpaste @@ -7,7 +7,7 @@ target_ssh="cloudsdale.hacktivis.me:pastes/${datetime}" target_www="https://cloudsdale.hacktivis.me/pastes/${datetime}" die() { - if [[ -z "$*" ]] + if [ -n "$*" ] then echo "${*}, exiting…" >&2 else echo "Failed, exiting…" >&2 fi @@ -16,7 +16,7 @@ die() { } sshpaste_file() { - test $(wc -c < "$1") -gt 1 || die "$1 is empty" + [ -s "$1" ] || die "$1 is empty" target_name=$(basename "$1") chmod +r "$1" if scp "$1" "${target_ssh}-${target_name}"