Contents of /mcore-src/trunk/mcore-tools/src/mcore-request-configuration.in
Parent Directory | Revision Log
Revision 2781 -
(show annotations)
(download)
Fri Feb 12 12:36:44 2016 UTC (8 years, 7 months ago) by niro
File size: 758 byte(s)
Fri Feb 12 12:36:44 2016 UTC (8 years, 7 months ago) by niro
File size: 758 byte(s)
-catch communincation errors with the controlserver in the configuration phase and show an error message if the configuration request failed
1 | #!/bin/bash |
2 | |
3 | MCORE_LIBDIR="@@MCORE_LIBDIR@@" |
4 | source @@SYSCONFDIR@@/mcore/mcore.conf |
5 | source ${MCORE_LIBDIR}/include/common.global.class |
6 | |
7 | 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 | SSLSAY_IP="${MCORE_CONTROL_SERVER}" |
17 | 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 | request_configuration_error "serial" |
23 | RETVAL=1 |
24 | else |
25 | 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 | fi |
35 | |
36 | exit ${RETVAL} |