31 |
mecho "set system.console [user]" |
mecho "set system.console [user]" |
32 |
mecho " Opens a console with user or root privileges." |
mecho " Opens a console with user or root privileges." |
33 |
mecho " Known users:" |
mecho " Known users:" |
34 |
mecho " mcore - mcore standard user only with user privileges" |
mecho " ${MCORE_UNPRIV_USER} - mcore standard user only with user privileges" |
35 |
mecho " root - mcore root user with full system privileges" |
mecho " root - mcore root user with full system privileges" |
36 |
} |
} |
37 |
|
|
39 |
{ |
{ |
40 |
mecho "set system.passwd [user] [password]" |
mecho "set system.passwd [user] [password]" |
41 |
mecho " Sets a system password for given user." |
mecho " Sets a system password for given user." |
42 |
mecho " Allowed users: mcore, root" |
mecho " Allowed users: ${MCORE_UNPRIV_USER}, root" |
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 |
|
|
61 |
[[ -z ${user} ]] && help_system_console && return 1 |
[[ -z ${user} ]] && help_system_console && return 1 |
62 |
|
|
63 |
case "${user}" in |
case "${user}" in |
64 |
mcore) x11runas "rxvt &" ;; |
${MCORE_UNPRIV_USER}) x11runas "rxvt &" ;; |
65 |
root) x11runas "rxvt -T 'Login as root' -e /bin/bash -c 'echo \"Login as root\";exec /bin/login root' &" ;; |
root) x11runas "rxvt -T 'Login as root' -e /bin/bash -c 'echo \"Login as root\";exec /bin/login root' &" ;; |
66 |
*) help_system_console && return 1 ;; |
*) help_system_console && return 1 ;; |
67 |
esac |
esac |
114 |
[[ -z ${pass} ]] && mecho "deleting password!" |
[[ -z ${pass} ]] && mecho "deleting password!" |
115 |
|
|
116 |
case "${user}" in |
case "${user}" in |
117 |
root|mcore) (echo "${pass}"; sleep 0.1; echo "${pass}") | passwd "${user}" ;; |
root|${MCORE_UNPRIV_USER}) (echo "${pass}"; sleep 0.1; echo "${pass}") | passwd "${user}" ;; |
118 |
*) help_system_passwd && return 1 ;; |
*) help_system_passwd && return 1 ;; |
119 |
esac |
esac |
120 |
} |
} |