2021-12-30 18:27:32 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
YEAR=$(date +%Y)
|
|
|
|
|
2021-12-30 19:56:13 +00:00
|
|
|
_int() {
|
|
|
|
echo "Caught SIGINT signal!"
|
|
|
|
kill -INT "$child1" 2>/dev/null
|
|
|
|
kill -INT "$child2" 2>/dev/null
|
|
|
|
}
|
|
|
|
|
|
|
|
trap _int SIGINT
|
|
|
|
|
|
|
|
socat -dd tcp4-listen:4646,reuseaddr,fork openssl:localhost:14646,cert=secrets/pki/nomad$YEAR-client.crt,key=secrets/pki/nomad$YEAR-client.key,cafile=secrets/pki/nomad$YEAR.crt &
|
|
|
|
child1=$!
|
|
|
|
|
|
|
|
socat -dd tcp4-listen:8500,reuseaddr,fork openssl:localhost:8501,cert=secrets/pki/consul$YEAR-client.crt,key=secrets/pki/consul$YEAR-client.key,cafile=secrets/pki/consul$YEAR.crt &
|
|
|
|
child2=$!
|
|
|
|
|
|
|
|
wait "$child1"
|
|
|
|
wait "$child2"
|