add missing linked library
[hband-ld-preload-libs.git] / src / autossl.sh
blob435f32f56ceae776c7fd0fda4387143f40728226
1 #!/bin/bash
3 echo "autossl.sh here called with $*" >&2
5 ip=$1
6 plain_port=$2
7 declare -A tls_ports
8 tls_ports=([21]=990 [23]=992 [25]=465 [80]=443 [110]=995 [119]=563 [143]=993 [194]=994 [389]=636)
10 tls_port=${tls_ports[$plain_port]}
12 if [ -z $tls_port ]
13 then
14 unset AUTOSSL_UPGRADE_PORTS
15 exec nc -v "$ip" "$plain_port"
16 else
17 echo "autossl.sh: opening TLS channel to $ip:$tls_port" >&2
18 openssl s_client -connect "$ip:$tls_port" -quiet