From ff24d747de6dd572ecdff2485b7001db37e7c5c2 Mon Sep 17 00:00:00 2001 From: Oliver Matthews Date: Thu, 16 Jul 2020 11:30:34 +0100 Subject: [PATCH] Fix minor typo, add thingy_compress.sh to allow compressing of existing downloads --- thingy_compress.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 thingy_compress.sh diff --git a/thingy_compress.sh b/thingy_compress.sh new file mode 100755 index 0000000..d4d641c --- /dev/null +++ b/thingy_compress.sh @@ -0,0 +1,26 @@ +#!/bin/sh +sourcefile=${1%/} + +if [ ! -d "$sourcefile" ] +then + echo "$1 does not appear to be a directory." + exit 1 +fi + +timestamp=$(cat "$sourcefile/timestamp.txt") + +if [ -z "$timestamp" ] +then + echo "No timestamp?" + exit 1 +fi + +output="${sourcefile} - ${timestamp}.7z" + +if [ -f "${output}" ] +then + echo "Target file ${output} already exists" + exit 1 +fi + +7z a -mx=9 "${output}" "${sourcefile}" -- 2.20.1