Magellan Linux

Annotation of /mcore-src/trunk/mcore-tools/src/modules/helpdesk/helpdesk.client.class.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2721 - (hide annotations) (download)
Fri Dec 18 14:20:49 2015 UTC (8 years, 5 months ago) by niro
File size: 1495 byte(s)
-fixed typos
1 niro 2720 # $Id$
2    
3     provide basic-version
4    
5     help_helpdesk_unit()
6     {
7     mecho "get helpdesk.unit"
8     mecho " Prints the current helpdesk unit name."
9     mecho
10     mecho "set helpdesk.unit [unit]"
11     mecho " Sets the current helpdesk unit name."
12     }
13    
14     help_helpdesk_phone()
15     {
16     mecho "get helpdesk.phone"
17     mecho " Prints the current helpdesk phone number."
18     mecho
19     mecho "set helpdesk.phone [phone]"
20     mecho " Sets the current helpdesk phone number."
21     }
22    
23     get_helpdesk_unit()
24     {
25     local unit
26    
27     if [ -f ${MCORE_CONFIG_PATH}/helpdesk/unit ]
28     then
29     unit="$(source ${MCORE_CONFIG_PATH}/helpdesk/unit; echo ${HELPDESK_UNIT})"
30     fi
31    
32     if [[ -z ${unit} ]]
33     then
34     unit="UNKNOWN"
35     fi
36    
37     rvecho "${unit}"
38     }
39    
40     get_helpdesk_phone()
41     {
42     local phone
43    
44     if [ -f ${MCORE_CONFIG_PATH}/helpdesk/phone ]
45     then
46     unit="$(source ${MCORE_CONFIG_PATH}/helpdesk/phone; echo ${HELPDESK_PHONE})"
47     fi
48    
49     if [[ -z ${phone} ]]
50     then
51     phone="UNKNOWN"
52     fi
53    
54     rvecho "${phone}"
55     }
56    
57     set_helpdesk_unit()
58     {
59     local unit="${CLASS_ARGV[0]}"
60    
61     [[ -z ${unit} ]] && help_helpdesk_unit && return 1
62     [[ -d ${MCORE_CONFIG_PATH}/helpdesk ]] || install -d ${MCORE_CONFIG_PATH}/helpdesk
63    
64     CONFIG="${MCORE_CONFIG_PATH}/helpdesk/unit"
65     clearconfig
66 niro 2721 addconfig "HELPDESK_UNIT=\"${unit}\""
67 niro 2720 }
68    
69     set_helpdesk_phone()
70     {
71     local phone="${CLASS_ARGV[0]}"
72    
73     [[ -z ${phone} ]] && help_helpdesk_phone && return 1
74     [[ -d ${MCORE_CONFIG_PATH}/helpdesk ]] || install -d ${MCORE_CONFIG_PATH}/helpdesk
75    
76     CONFIG="${MCORE_CONFIG_PATH}/helpdesk/phone"
77     clearconfig
78 niro 2721 addconfig "HELPDESK_PHONE=\"${phone}\""
79 niro 2720 }