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 1328 by niro, Fri Feb 4 20:05:37 2011 UTC revision 1329 by niro, Mon Feb 14 17:59:46 2011 UTC
# Line 43  help_system_passwd() Line 43  help_system_passwd()
43   mecho "  If password is empty, the current password will be deleted."   mecho "  If password is empty, the current password will be deleted."
44  }  }
45    
46    help_system_autologon()
47    {
48     mecho "get system.autologon"
49     mecho "  Shows the state of autlogon"
50     mecho
51     mecho "set system.autologon [action]"
52     mecho " Enables or disables X11 autologins of the mcore user."
53     mecho "  Available actions:"
54     mecho "      enable  - enables autologon"
55     mecho "      disable - disables autologon"
56    }
57    
58  set_system_console()  set_system_console()
59  {  {
60   local user="$1"   local user="$1"
# Line 136  get_system_vt() Line 148  get_system_vt()
148   tty="$(fgconsole)"   tty="$(fgconsole)"
149   mecho "${tty}"   mecho "${tty}"
150  }  }
151    
152    get_system_autologon()
153    {
154     local var
155     var=$(grep auto_login /etc/slim.conf | sed 's:auto_login.*\([yn].*\):\1:')
156     case "${var}" in
157     yes) mecho "autologon currently enabled" ;;
158     no) mecho "autologon currently disabled" ;;
159     *) eecho "unkown state" ;;
160     esac
161    }
162    
163    set_system_autologon()
164    {
165     local action
166     [[ -z ${action} ]] && help_system_autologon && return 1
167    
168     ## splash X11 tty too?
169    
170     case "${action}" in
171     enable)
172     sed 's:^auto_login.*:\1\tyes' /etc/slim.conf
173     mecho "autologon enabled"
174     ;;
175     disable)
176     sed 's:^auto_login.*:\1\tno' /etc/slim.conf
177     mecho "autologon disabled"
178     ;;
179     *) help_system_autologon && return 1 ;;
180     esac
181    }

Legend:
Removed from v.1328  
changed lines
  Added in v.1329