aboutsummaryrefslogtreecommitdiff
path: root/bin/urlc
diff options
context:
space:
mode:
Diffstat (limited to 'bin/urlc')
-rwxr-xr-xbin/urlc7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/urlc b/bin/urlc
index 63f075bf..e306d48f 100755
--- a/bin/urlc
+++ b/bin/urlc
@@ -5,8 +5,8 @@ self=urlc
# cURL request timeout
tm=${URLCHECK_TIMEOUT:-8}
-# Create buffer files for the headers and body content, to be cleaned up on
-# exit
+# Create a temporary directory with name in $td, and handle POSIX-ish traps to
+# remove it when the script exits.
td=
cleanup() {
[ -n "$td" ] && rm -fr -- "$td"
@@ -20,6 +20,9 @@ for sig in EXIT HUP INT TERM ; do
trap "cleanup $sig" "$sig"
done
td=$(mktd "$self") || exit
+
+# Create buffer files for the headers and body content, to be cleaned up on
+# exit
list=$td/list head=$td/head body=$td/body
# Iterate through input; ignore leading/trailing whitespace