diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-08-26 16:57:13 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-08-26 16:57:13 -0400 |
| commit | 9d7e3b4b8e35469fd2bded70e0ee473e4afc46de (patch) | |
| tree | 9d92ac617c6ed185e8a6f1160bb4e32b71a770fd | |
| parent | 5e3ad97b79980d285054e0ac0052f86b1076a4df (diff) | |
| download | misc-scripts-9d7e3b4b8e35469fd2bded70e0ee473e4afc46de.tar.gz | |
litterbox: use mktemp; do not double-compress .zip or .gz files.
| -rwxr-xr-x | litterbox | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -9,6 +9,8 @@ URLS="" EXPIRE="1" DELAY="${DELAY:-2}" UPLOAD_COUNT=0 +TMP="$( mktemp -t -d $SELF.XXXXXXXXXX )" +trap cleanup EXIT die() { echo "$SELF: fatal: $@" 1>&2 @@ -27,6 +29,10 @@ check_path() { type -p "$1" &>/dev/null } +cleanup() { + [ "$TMP" != "" ] && rm -rf "$TMP" +} + usage() { if ! check_path perldoc; then warn "can't find perldoc on PATH, printing raw POD." @@ -127,6 +133,8 @@ upload_file() { *.exe|*.scr|*.cpl|*.doc*|*.jar) warn "forbidden file extension, compression forced" use_compression=1 ;; + *.zip|*.gz) + use_compression=0 ;; *) use_compression="$COMPRESS" ;; esac |
