Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/include/common.global.class.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2428 by niro, Thu Sep 3 08:15:59 2015 UTC revision 2485 by niro, Thu Sep 10 12:29:57 2015 UTC
# Line 9  mecho() Line 9  mecho()
9   local webcrlf   local webcrlf
10    
11   # print nothing if quiet mode was requested   # print nothing if quiet mode was requested
12   [[ ${QUIET} = true ]] && return   [[ ${QUIET} = 1 ]] && return
13    
14   if [[ ${NOCOLORS} = true ]]   if [[ ${NOCOLORS} = 1 ]]
15   then   then
16   COLCYAN=""   COLCYAN=""
17   COLDEFAULT=""   COLDEFAULT=""
18   fi   fi
19    
20   [[ ${WEBCRLF} = true ]] && webcrlf="<br>"   [[ ${WEBCRLF} = 1 ]] && webcrlf="<br>"
21    
22   # respect -n   # respect -n
23   case $1 in   case $1 in
# Line 35  eecho() Line 35  eecho()
35   local opts   local opts
36   local webcrlf   local webcrlf
37    
38   if [[ ${NOCOLORS} = true ]]   if [[ ${NOCOLORS} = 1 ]]
39   then   then
40   COLRED=""   COLRED=""
41   COLDEFAULT=""   COLDEFAULT=""
42   fi   fi
43    
44   [[ ${WEBCRLF} = true ]] && webcrlf="<br>"   [[ ${WEBCRLF} = 1 ]] && webcrlf="<br>"
45    
46   # respect -n   # respect -n
47   case $1 in   case $1 in
# Line 59  rvecho() Line 59  rvecho()
59   local opts   local opts
60   local webcrlf   local webcrlf
61    
62   if [[ ${NOCOLORS} = true ]]   if [[ ${NOCOLORS} = 1 ]]
63   then   then
64   COLPURPLE=""   COLPURPLE=""
65   COLDEFAULT=""   COLDEFAULT=""
66   fi   fi
67    
68   [[ ${WEBCRLF} = true ]] && webcrlf="<br>"   [[ ${WEBCRLF} = 1 ]] && webcrlf="<br>"
69    
70   # respect -n   # respect -n
71   case $1 in   case $1 in
# Line 351  key_fingerprint() Line 351  key_fingerprint()
351   fi   fi
352  }  }
353    
354    nsslsay()
355    {
356     nssl "${SSLSAY_IP}" "${SSLSAY_PORT}" << EOF
357    auth ${SSLSAY_USER} ${SSLSAY_PASS}
358    $@
359    quit
360    EOF
361    }
362    
363    nsslsay_fingerprint()
364    {
365     nssl "${SSLSAY_IP}" "${SSLSAY_PORT}" << EOF
366    certauth $(certificate_fingerprint)
367    $@
368    quit
369    EOF
370    }
371    
372    nsslsay_queue_init()
373    {
374     SSLSAY_QUEUE=()
375    }
376    
377    nsslsay_queue_add()
378    {
379     SSLSAY_QUEUE+=( "$@" )
380    }
381    
382    nsslsay_queue_print()
383    {
384     local count
385     local i
386    
387     count="${#SSLSAY_QUEUE[*]}"
388     for ((i=0; i < count; i++))
389     do
390     echo "${SSLSAY_QUEUE[${i}]}"
391     done
392    }
393    
394    nsslsay_queue_run()
395    {
396     nsslsay "$(nsslsay_queue_print)"
397    }
398    
399    nsslsay_queue_run_fingerprint()
400    {
401     nsslsay_fingerprint "$(nsslsay_queue_print)"
402    }

Legend:
Removed from v.2428  
changed lines
  Added in v.2485