summarylogtreecommitdiffstats
path: root/02-relocation-tmp-and-log-folder.patch
blob: 434284cfb1ac58041740d650ee81f60028adefef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff --git a/bin/htrace.sh b/bin/htrace.sh
index 125f078..549bdc5 100755
--- a/bin/htrace.sh
+++ b/bin/htrace.sh
@@ -74,8 +74,8 @@ readonly _rel="${_init_directory}/.."
 # shellcheck disable=SC2154
 readonly _src="${_rel}/src"
 readonly _lib="${_rel}/lib"
-readonly _tmp="${_rel}/tmp"
-readonly _log="${_rel}/log"
+readonly _tmp="$(mktemp -d)"
+readonly _log="/tmp/htrace.sh-log"
 
 # shellcheck disable=SC1090
 source "${_src}/../config"
diff --git a/lib/DomainChainCheck b/lib/DomainChainCheck
index b54544b..a35d886 100644
--- a/lib/DomainChainCheck
+++ b/lib/DomainChainCheck
@@ -41,7 +41,7 @@ function DomainChainCheck() {
   echo | \
   $_openssl s_client -showcerts -verify 5 -servername "$_ssl_domain_name" \
   -connect "$_ssl_remote_socket" 2>&1 | \
-  awk '/BEGIN CERTIFICATE/,/END CERTIFICATE/{ if(/BEGIN CERTIFICATE/){a++}; out="../tmp/cert"a".crt"; print >out}'
+  awk "/BEGIN CERTIFICATE/,/END CERTIFICATE/{ if(/BEGIN CERTIFICATE/){a++}; out="${_tmp}/cert"a".crt"; print >out}"

   # shellcheck disable=SC2154
   for _c_fd in "${_tmp}"/*.crt ; do