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 2427 by niro, Tue Sep 1 08:36:09 2015 UTC revision 2428 by niro, Thu Sep 3 08:15:59 2015 UTC
# Line 292  mac_for_iface() Line 292  mac_for_iface()
292   cat /sys/class/net/${iface}/address   cat /sys/class/net/${iface}/address
293   fi   fi
294  }  }
295    
296    certificate_fingerprint()
297    {
298     local cert_fingerprint
299     local retval
300    
301     if [[ ! -f ${MCORE_CERT_FILE} ]]
302     then
303     eecho "MCORE_CERT_FILE '${MCORE_CERT_FILE}' does not exist."
304     return 1
305     fi
306    
307     cert_fingerprint=$(openssl x509 -noout -modulus -in "${MCORE_CERT_FILE}" | openssl sha1 | sed 's:(stdin)=\ ::')
308     retval="$?"
309    
310     if [[ ${retval} != 0 ]]
311     then
312     eecho "Error '${retval}' while generating cert_fingerprint."
313     return 1
314     fi
315    
316     if [[ -z ${cert_fingerprint} ]]
317     then
318     eecho "Error: cert_fingerprint is empty"
319     return 1
320     else
321     echo "${cert_fingerprint}"
322     fi
323    }
324    
325    key_fingerprint()
326    {
327     local key_fingerprint
328     local retval
329    
330     if [[ ! -f ${MCORE_KEY_FILE} ]]
331     then
332     eecho "MCORE_KEY_FILE '${MCORE_KEY_FILE}' does not exist."
333     return 1
334     fi
335    
336     key_fingerprint=$(openssl rsa -noout -modulus -in "${MCORE_KEY_FILE}" | openssl sha1 | sed 's:(stdin)=\ ::')
337     retval="$?"
338    
339     if [[ ${retval} != 0 ]]
340     then
341     eecho "Error '${retval}' while generating key_fingerprint."
342     return 1
343     fi
344    
345     if [[ -z ${key_fingerprint} ]]
346     then
347     eecho "Error: key_fingerprint is empty"
348     return 1
349     else
350     echo "${key_fingerprint}"
351     fi
352    }
353    

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