⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 check_http.sh

📁 The Kannel Open Source WAP and SMS gateway works as both an SMS gateway, for implementing keyword b
💻 SH
字号:
#!/bin/sh # # Use `test/test_http{,_server}' to test gwlib/http.c. # Incuding the SSL client and server componentes, if, of course, SSL has been# enabled.  set -e #set -x times=2 port="8040" port_ssl="8041" url="http://localhost:$port/foo.txt" url_ssl="https://localhost:$port_ssl/foo.txt" quiturl="http://localhost:$port/quit" quiturl_ssl="https://localhost:$port_ssl/quit" ssl_cert="gw/cert.pem" ssl_key="gw/key.pem" ssl_clientcert="/tmp/clientcert.pem" loglevel=0ssl_enabled=yes  cat $ssl_cert $ssl_key > $ssl_clientcert  test/test_http_server -p $port -v $loglevel > check_http_server.log 2>&1 & serverpid=$!  sleep 1  test/test_http_server -p $port_ssl -v $loglevel -s -c $ssl_cert -k $ssl_key > check_https_server.log 2>&1 & serverpid_ssl=$! sleep 1  test/test_http -r $times $url > check_http.log 2>&1 ret=$?test/test_http -r 1 -s -c $ssl_clientcert $url_ssl > check_https.log 2>&1 ret=$? if grep 'SSL not compiled in' check_https.log > /dev/nullthen    echo 'do not check SSL, SSL not compiled in'    ssl_enabled=nofiif test "$ssl_enabled" = "yes"then    echo -n ' checking SSL connections, too...'    test/test_http -r $times -s -c $ssl_clientcert $url_ssl > check_https.log 2>&1 ret=$?else    test/test_http -r 1 -s -c $ssl_clientcert $quiturl_ssl >> check_https.log 2>&1    rm -f check_https.logfi test/test_http -r 1 $quiturl >> check_http.log 2>&1if test "$ssl_enabled" = "yes"then     test/test_http -r 1 -s -c $ssl_clientcert $quiturl_ssl >> check_https.log 2>&1fi sleep 2if grep 'ERROR:|PANIC:' check_http.log check_http_server.log  > /dev/null  then 	echo check_http failed 1>&2 	echo See check_http.log and check_http_server.log for info 1>&2 	exit 1 fi if test "$ssl_enabled" = "yes"then    if grep 'ERROR:|PANIC' check_https.log check_https_server.log > /dev/null    then        echo check_https failed 1>&2        echo see check_https_log and check_http_server.log for info 1>&2        exit 1    fifirm check_http*.logrm $ssl_clientcertexit 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -