Magellan Linux

Contents of /mcore-src/trunk/mcore-tools/nsslsay

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2479 - (show annotations) (download)
Thu Sep 10 08:48:45 2015 UTC (8 years, 7 months ago) by niro
File size: 560 byte(s)
-use 0/1 for bool values instead of mixed 0/1 and true/false settings
1 #!/bin/sh
2
3 : ${IP="192.168.0.14"}
4 : ${PORT="6666"}
5 : ${SSLSAY_USER="mcore"}
6 : ${SSLSAY_PASS="foobar"}
7 : ${QUIET=""}
8 : ${NOCOLORS=""}
9 : ${WEBCRLF=""}
10 : ${MROOT=""}
11
12 nsslsay()
13 {
14 local message
15
16 [[ ${QUIET} = 1 ]] && message+="quiet"$'\n'
17 [[ ${NOCOLORS} = 1 ]] && message+="nocolors"$'\n'
18 [[ ${WEBCRLF} = 1 ]] && message+="webcrlf"$'\n'
19
20 message+="auth ${SSLSAY_USER} ${SSLSAY_PASS}"$'\n'
21 [[ ! -z ${MROOT} ]] && message+="set daemon.mroot ${MROOT}"$'\n'
22 message+="$@"$'\n'
23 message+="quit"$'\n'
24
25 nssl "${IP}" "${PORT}" << EOF
26 ${message}
27 EOF
28
29 }
30
31 nsslsay $@