From 97a37de7c92882d304bd47593837e32148a7c986 Mon Sep 17 00:00:00 2001 From: BDR Date: Sun, 28 Mar 2021 22:20:27 +0200 Subject: [PATCH] Use mktemp for temp dir --- tinystatus | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tinystatus b/tinystatus index 4907ffc..2c157ca 100755 --- a/tinystatus +++ b/tinystatus @@ -2,10 +2,10 @@ title=tinystatus timeout=10 -tmp='/tmp/tinystatus' -useragent="User-Agent: Mozilla/5.0 (X11; Linux x86_64; Debian) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" +tmp="$(mktemp -d)" checkfile="${1:-checks.list}" incidentsfile="${2:-incidents.list}" +useragent="User-Agent: Mozilla/5.0 (X11; Linux x86_64; Debian) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" command_exists(){ if ! command -v "${1}" >/dev/null 2>&1; then @@ -51,7 +51,6 @@ check(){ command_exists 'curl' command_exists 'nc' -rm -r "${tmp}" mkdir -p "${tmp}/ok" "${tmp}/ko" || exit 1 while IFS='\n' read -r line; do @@ -119,4 +118,5 @@ cat < EOF +rm -r "${tmp}" 2>/dev/null