Magellan Linux

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

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

revision 1336 by niro, Thu Feb 17 20:18:46 2011 UTC revision 2057 by niro, Wed May 8 12:02:09 2013 UTC
# Line 23  help_system_shutdown() Line 23  help_system_shutdown()
23  # set_system_shutdown  # set_system_shutdown
24  set_system_shutdown()  set_system_shutdown()
25  {  {
26   halt   poweroff
27  }  }
28    
29  help_system_console()  help_system_console()
# Line 72  help_system_service() Line 72  help_system_service()
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 "   status  - prints status of given service"
76   mecho "   start   - starts given service"   mecho "   start   - starts given service"
77   mecho "   stop    - stops given service"   mecho "   stop    - stops given service"
78   mecho "   restart - restart given service"   mecho "   restart - restart given service"
# Line 89  set_system_service() Line 90  set_system_service()
90   [[ -z ${command} ]] && help_system_service && return 1   [[ -z ${command} ]] && help_system_service && return 1
91   [[ -z ${service} ]] && help_system_service && return 1   [[ -z ${service} ]] && help_system_service && return 1
92    
93   if [[ ! -x /etc/rc.d/init.d/${service} ]]   if [[ ! -x ${MROOT}/etc/rc.d/init.d/${service} ]]
94   then   then
95   mecho "Service '${service}' unkown!"   eecho "Service '${service}' unkown!"
96   fi   fi
97    
98   case "${command}" in   case "${command}" in
# Line 99  set_system_service() Line 100  set_system_service()
100   stop) /etc/rc.d/init.d/"${service}" stop ;;   stop) /etc/rc.d/init.d/"${service}" stop ;;
101   restart) /etc/rc.d/init.d/"${service}" restart ;;   restart) /etc/rc.d/init.d/"${service}" restart ;;
102   reload) /etc/rc.d/init.d/"${service}" reload ;;   reload) /etc/rc.d/init.d/"${service}" reload ;;
103     status) /etc/rc.d/init.d/"${service}" status ;;
104   add) rc-config add "${service}" ;;   add) rc-config add "${service}" ;;
105   del) rc-config del "${service}" ;;   del) rc-config del "${service}" ;;
106   *) help_system_service && return ;;   *) help_system_service && return ;;
# Line 146  get_system_vt() Line 148  get_system_vt()
148  {  {
149   local tty   local tty
150   tty="$(fgconsole)"   tty="$(fgconsole)"
151   mecho "${tty}"   rvecho "${tty}"
152  }  }
153    
154  get_system_autologon()  get_system_autologon()
# Line 154  get_system_autologon() Line 156  get_system_autologon()
156   local var   local var
157   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:')
158   case "${var}" in   case "${var}" in
159   yes) mecho "autologon currently enabled" ;;   yes) mecho "autologon currently enabled"; rvecho "1" ;;
160   no) mecho "autologon currently disabled" ;;   no) mecho "autologon currently disabled"; rvecho "0" ;;
161   *) eecho "unkown state" ;;   *) eecho "unkown state" ;;
162   esac   esac
163  }  }
164    
165  set_system_autologon()  set_system_autologon()
166  {  {
167   local action   local action="$1"
168   [[ -z ${action} ]] && help_system_autologon && return 1   [[ -z ${action} ]] && help_system_autologon && return 1
169    
170   ## splash X11 tty too?   ## splash X11 tty too?
171    
172   case "${action}" in   case "${action}" in
173   enable)   enable)
174   sed 's:^auto_login.*:\1\tyes' /etc/slim.conf   sed -i 's:^\(auto_login\).*:\1\tyes:' /etc/slim.conf
175   mecho "autologon enabled"   mecho "autologon enabled"
176   ;;   ;;
177   disable)   disable)
178   sed 's:^auto_login.*:\1\tno' /etc/slim.conf   sed -i 's:^\(auto_login\).*:\1\tno:' /etc/slim.conf
179   mecho "autologon disabled"   mecho "autologon disabled"
180   ;;   ;;
181   *) help_system_autologon && return 1 ;;   *) help_system_autologon && return 1 ;;

Legend:
Removed from v.1336  
changed lines
  Added in v.2057