Magellan Linux

Annotation of /mcore-src/trunk/mcore-tools/src/mcore-request-configuration.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2787 - (hide annotations) (download)
Wed Feb 17 10:49:12 2016 UTC (8 years, 4 months ago) by niro
File size: 757 byte(s)
-use mcore-controlserver executable instead of the MCORE_CONTROL_SERVER variable everywhere to honor MCORE_CONTROLSERVER from cmdline and also catch even more communication errors as the executable verifies the availablity of the server
1 niro 2590 #!/bin/bash
2    
3     MCORE_LIBDIR="@@MCORE_LIBDIR@@"
4     source @@SYSCONFDIR@@/mcore/mcore.conf
5     source ${MCORE_LIBDIR}/include/common.global.class
6    
7 niro 2781 request_configuration_error()
8     {
9     local reason="$1"
10     local CONFIG
11     CONFIG="${MCORE_CONFIG_PATH}/request-configuratation-error"
12     clearconfig
13     addconfig "${reason}"
14     }
15    
16 niro 2787 SSLSAY_IP="$(mcore-controlserver)"
17 niro 2590 SSLSAY_PORT="6666"
18    
19     if [[ -z $(mcore-serial) ]] || [[ $(mcore-serial) = UNKNOWN ]]
20     then
21     decho "No serial, will not retrive configuration from server"
22 niro 2781 request_configuration_error "serial"
23 niro 2590 RETVAL=1
24     else
25 niro 2781 if mcore-controlserver
26     then
27     nsslsay_fingerprint push-config $(mcore-serial)
28     RETVAL=0
29     else
30     decho "Could not reach controlserver"
31     request_configuration_error "controlserver"
32     RETVAL=1
33     fi
34 niro 2590 fi
35    
36     exit ${RETVAL}