aboutsummaryrefslogtreecommitdiff
path: root/bin/tmp
diff options
context:
space:
mode:
Diffstat (limited to 'bin/tmp')
-rwxr-xr-xbin/tmp5
1 files changed, 2 insertions, 3 deletions
diff --git a/bin/tmp b/bin/tmp
index df7f097..cf46d8a 100755
--- a/bin/tmp
+++ b/bin/tmp
@@ -58,7 +58,7 @@ while getopts 'dh' flag; do
case "$flag" in
d)
printf 'Deleting %s:%s...\n' "$REMOTE" "$DIR/" >&2
- ssh "$REMOTE" rm -rf "$DIR"
+ ssh "$REMOTE" rm -rf "$DIR"/*
exit
;;
h)
@@ -82,8 +82,7 @@ fi
for f in "$@"; do
FILENAME="$(basename "$f")"
- # shellcheck disable=2029
- ssh "$REMOTE" "mkdir -p '$DIR' && cat > '$DIR/$FILENAME'" < "$f"
+ ssh "$REMOTE" dd of="$DIR/$FILENAME" < "$f"
LINK="$(printf 'https://%s/tmp/%s' "$REMOTE" "$FILENAME")"
open "$LINK"