Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/daemon/include/daemon.global.class

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1307 by niro, Fri Feb 4 20:13:23 2011 UTC revision 1308 by niro, Sun Feb 6 23:48:20 2011 UTC
# Line 26  run_class() Line 26  run_class()
26   local cmd   local cmd
27   local argv   local argv
28    
29   if validate_session   if valid_session
30   then   then
31   class="${caller%.*}"   class="${caller%.*}"
32   cmd="${caller#*.}"   cmd="${caller#*.}"
# Line 63  help_topics() Line 63  help_topics()
63   mecho "\tset     - sets value for a setting"   mecho "\tset     - sets value for a setting"
64   mecho "\tauth    - authenticate to the daemon"   mecho "\tauth    - authenticate to the daemon"
65   mecho "\tprovide - shows provides of a system"   mecho "\tprovide - shows provides of a system"
66     mecho "\trequire - verify plugin requirements"
67     mecho "\nocolors - disable colors, useful for the webclient"
68   mecho "\thelp    - shows help"   mecho "\thelp    - shows help"
69   mecho "\tquit    - quits the connection to the server"   mecho "\tquit    - quits the connection to the server"
70   mecho   mecho
# Line 88  x11runas() Line 90  x11runas()
90    
91  addconfig()  addconfig()
92  {  {
93     local opts
94    
95   if [[ -z ${CONFIG} ]]   if [[ -z ${CONFIG} ]]
96   then   then
97   echo "You must define \$CONFIG varibale first!"   echo "You must define \$CONFIG varibale first!"
# Line 98  addconfig() Line 102  addconfig()
102   then   then
103   install -d $(dirname ${CONFIG})   install -d $(dirname ${CONFIG})
104   fi   fi
105   echo "$@" >> ${CONFIG}  
106     # check for opts
107     case $1 in
108     -n) shift; opts=" -n" ;;
109     -e) shift; opts=" -e" ;;
110     esac
111    
112     echo ${opts} "$@" >> ${CONFIG}
113  }  }
114    
115  clearconfig()  clearconfig()
# Line 222  mecho() Line 233  mecho()
233   local COLCYAN="\033[1;36m"   local COLCYAN="\033[1;36m"
234   local COLDEFAULT="\033[0m"   local COLDEFAULT="\033[0m"
235   local opts   local opts
236     local webcrlf
237    
238   if [[ ${NOCOLORS} = true ]]   if [[ ${NOCOLORS} = true ]]
239   then   then
# Line 229  mecho() Line 241  mecho()
241   COLDEFAULT=""   COLDEFAULT=""
242   fi   fi
243    
244     [[ ${WEBCRLF} = true ]] && webcrlf="<br>"
245    
246   # respect -n   # respect -n
247   case $1 in   case $1 in
248   -n) shift; opts="n" ;;   -n) shift; opts="n" ;;
249   esac   esac
250    
251   echo -e${opts} "${COLCYAN}$@${COLDEFAULT}"   echo -e${opts} "${COLCYAN}$@${COLDEFAULT}${webcrlf}"
252  }  }
253    
254  eecho()  eecho()
# Line 242  eecho() Line 256  eecho()
256   local COLRED="\033[1;31m"   local COLRED="\033[1;31m"
257   local COLDEFAULT="\033[0m"   local COLDEFAULT="\033[0m"
258   local opts   local opts
259     local webcrlf
260    
261   if [[ ${NOCOLORS} = true ]]   if [[ ${NOCOLORS} = true ]]
262   then   then
# Line 249  eecho() Line 264  eecho()
264   COLDEFAULT=""   COLDEFAULT=""
265   fi   fi
266    
267     [[ ${WEBCRLF} = true ]] && webcrlf="<br>"
268    
269   # respect -n   # respect -n
270   case $1 in   case $1 in
271   -n) shift; opts="n" ;;   -n) shift; opts="n" ;;
272   esac   esac
273    
274   echo -e${opts} "${COLRED}$@${COLDEFAULT}"   echo -e${opts} "${COLRED}$@${COLDEFAULT}${webcrlf}"
275  }  }
276    
277  path_not_empty()  path_not_empty()

Legend:
Removed from v.1307  
changed lines
  Added in v.1308