Annotation of /mcore-src/trunk/mcore-tools/src/modules/network/network.control.class.in
Parent Directory | Revision Log
Revision 2574 -
(hide annotations)
(download)
Thu Sep 17 10:41:13 2015 UTC (8 years, 7 months ago) by niro
File size: 986 byte(s)
Thu Sep 17 10:41:13 2015 UTC (8 years, 7 months ago) by niro
File size: 986 byte(s)
-set push-config prio
1 | niro | 2573 | # $Id$ |
2 | |||
3 | niro | 2574 | push_config 10_network_hostname |
4 | niro | 2573 | |
5 | help_network_hostname() | ||
6 | { | ||
7 | local serial="${CLASS_ARGV[0]}" | ||
8 | control_client "${serial}" help network.hostname | ||
9 | |||
10 | mecho "get network.hostname" | ||
11 | mecho " Displays the current hostname" | ||
12 | mecho | ||
13 | mecho "set network.hostname [hostname]" | ||
14 | mecho " Sets the hostname of the system" | ||
15 | mecho " mcore - the local hostname" | ||
16 | } | ||
17 | |||
18 | set_network_hostname() | ||
19 | { | ||
20 | local serial="${CLASS_ARGV[0]}" | ||
21 | local value="${CLASS_ARGV[1]}" | ||
22 | |||
23 | import_resource cfg_network "${serial}" hostname "${value}" | ||
24 | } | ||
25 | |||
26 | control_network_hostname() | ||
27 | { | ||
28 | local serial="${CLASS_ARGV[0]}" | ||
29 | niro | 2574 | push_config_10_network_hostname "${serial}" |
30 | niro | 2573 | } |
31 | |||
32 | niro | 2574 | push_config_10_network_hostanme() |
33 | niro | 2573 | { |
34 | local serial="$1" | ||
35 | local value | ||
36 | |||
37 | value=$(mysqldo "select hostname from cfg_network where serial='${serial}'") | ||
38 | if [[ -z ${value} ]] || [[ ${value} = NULL ]] | ||
39 | then | ||
40 | decho "retval NULL, not running 'control_client '${serial}' set network.hostname '${value}''" | ||
41 | else | ||
42 | control_client "${serial}" set network.hostname "${value}" | ||
43 | fi | ||
44 | } |