1 |
# $Id$ |
# $Id$ |
2 |
|
|
3 |
provide basic-system |
provide basic-system |
4 |
|
require basic-init |
5 |
|
|
6 |
help_system_reboot() |
help_system_reboot() |
7 |
{ |
{ |
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" |
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 " status - prints status of given service" |
mecho " start - starts given service" |
76 |
mecho " start - starts given service" |
mecho " stop - stops given service" |
77 |
mecho " stop - stops given service" |
mecho " restart - restart given service" |
78 |
mecho " restart - restart given service" |
mecho " reload - reloads given service if possible" |
79 |
mecho " reload - reloads given service if possible" |
mecho " add - adds a service to default runlevels" |
80 |
mecho " add - adds a service to default runlevels" |
mecho " del - deletes a service from all runlevels" |
81 |
mecho " del - deletes a service from all runlevels" |
} |
82 |
} |
|
83 |
|
help_system_passwd() |
84 |
set_system_service() |
{ |
85 |
{ |
mecho "set system.passwd [user] [password]" |
86 |
local command="$1" |
mecho " Sets a system password for given user." |
87 |
local service="$2" |
mecho " Allowed users: ${MCORE_UNPRIV_USER}, root" |
88 |
local opts="$3" |
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 ${MROOT}/etc/rc.d/init.d/${service} ]] |
|
|
then |
|
|
eecho "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 ;; |
|
|
status) /etc/rc.d/init.d/"${service}" status ;; |
|
|
add) rc-config add "${service}" ;; |
|
|
del) rc-config del "${service}" ;; |
|
|
*) help_system_service && return ;; |
|
|
esac |
|
89 |
} |
} |
90 |
|
|
91 |
set_system_passwd() |
set_system_passwd() |