add a nice friendly error if the certificate for stunnel are not

present.
This commit is contained in:
Vincent Hanquez 2013-02-09 14:20:01 +00:00
parent c26cf3d1fd
commit 75953f1885

View file

@ -8,6 +8,16 @@ fi
PORT=$(($$ % 10000 + 10000))
if [ ! -f server.crt ]; then
echo "generate some certificate \"server.crt\""
exit 2
fi
if [ ! -f server.key ]; then
echo "generate some private key \"server.key\""
exit 2
fi
echo "running stunnel"
${STUNNEL} server -c server.crt -k server.key --source=localhost:${PORT} --destinationtype=fd --destination=2 > stunnel-gnutls-log 2>&1 &
stunnelpid=$(pidof stunnel)