Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/modules/basic-system/system.client.class.in

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

revision 1345 by niro, Thu Feb 17 21:16:24 2011 UTC revision 2079 by niro, Fri May 10 11:37:38 2013 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    
3  provide basic-system  provide basic-system
4    require basic-init
5    
6  help_system_reboot()  help_system_reboot()
7  {  {
# Line 23  help_system_shutdown() Line 24  help_system_shutdown()
24  # set_system_shutdown  # set_system_shutdown
25  set_system_shutdown()  set_system_shutdown()
26  {  {
27   halt   poweroff
28  }  }
29    
30  help_system_console()  help_system_console()
# Line 35  help_system_console() Line 36  help_system_console()
36   mecho "   root   - mcore root user with full system privileges"   mecho "   root   - mcore root user with full system privileges"
37  }  }
38    
 help_system_passwd()  
 {  
  mecho "set system.passwd [user] [password]"  
  mecho " Sets a system password for given user."  
  mecho "  Allowed users: ${MCORE_UNPRIV_USER}, root"  
  mecho "  If password is empty, the current password will be deleted."  
 }  
   
39  help_system_autologon()  help_system_autologon()
40  {  {
41   mecho "get system.autologon"   mecho "get system.autologon"
# Line 69  set_system_console() Line 62  set_system_console()
62    
63  help_system_service()  help_system_service()
64  {  {
65     mecho "get system.service [command] [service]"
66     mecho " Status information of system services."
67     mecho " Commands:"
68     mecho "   status   - prints status of given service"
69     mecho "   enabled  - check whether a service was enabled"
70     mecho "   runlevel - print current system runlevel"
71     mecho
72   mecho "set system.service [command] [service] [opts]"   mecho "set system.service [command] [service] [opts]"
73   mecho " Controls system services."   mecho " Controls system services."
74   mecho " Commands:"   mecho " Commands:"
75   mecho "   start   - starts given service"   mecho "   start    - starts given service"
76   mecho "   stop    - stops given service"   mecho "   stop     - stops given service"
77   mecho "   restart - restart given service"   mecho "   restart  - restart given service"
78   mecho "   reload  - reloads given service if possible"   mecho "   reload   - reloads given service if possible"
79   mecho "   add     - adds a service to default runlevels"   mecho "   add      - adds a service to default runlevels"
80   mecho "   del     - deletes a service from all runlevels"   mecho "   del      - deletes a service from all runlevels"
81  }  }
82    
83  set_system_service()  help_system_passwd()
84  {  {
85   local command="$1"   mecho "set system.passwd [user] [password]"
86   local service="$2"   mecho " Sets a system password for given user."
87   local opts="$3"   mecho "  Allowed users: ${MCORE_UNPRIV_USER}, root"
88     mecho "  If password is empty, the current password will be deleted."
  [[ -z ${command} ]] && help_system_service && return 1  
  [[ -z ${service} ]] && help_system_service && return 1  
   
  if [[ ! -x /etc/rc.d/init.d/${service} ]]  
  then  
  mecho "Service '${service}' unkown!"  
  fi  
   
  case "${command}" in  
  start) /etc/rc.d/init.d/"${service}" start ;;  
  stop) /etc/rc.d/init.d/"${service}" stop ;;  
  restart) /etc/rc.d/init.d/"${service}" restart ;;  
  reload) /etc/rc.d/init.d/"${service}" reload ;;  
  add) rc-config add "${service}" ;;  
  del) rc-config del "${service}" ;;  
  *) help_system_service && return ;;  
  esac  
89  }  }
90    
91  set_system_passwd()  set_system_passwd()
# Line 146  get_system_vt() Line 129  get_system_vt()
129  {  {
130   local tty   local tty
131   tty="$(fgconsole)"   tty="$(fgconsole)"
132   mecho "${tty}"   rvecho "${tty}"
133  }  }
134    
135  get_system_autologon()  get_system_autologon()
# Line 154  get_system_autologon() Line 137  get_system_autologon()
137   local var   local var
138   var=$(grep auto_login /etc/slim.conf | sed 's:auto_login.*\([yn].*\):\1:')   var=$(grep auto_login /etc/slim.conf | sed 's:auto_login.*\([yn].*\):\1:')
139   case "${var}" in   case "${var}" in
140   yes) mecho "autologon currently enabled" ;;   yes) mecho "autologon currently enabled"; rvecho "1" ;;
141   no) mecho "autologon currently disabled" ;;   no) mecho "autologon currently disabled"; rvecho "0" ;;
142   *) eecho "unkown state" ;;   *) eecho "unkown state" ;;
143   esac   esac
144  }  }

Legend:
Removed from v.1345  
changed lines
  Added in v.2079