5 |
|
|
6 |
set_system_service() |
set_system_service() |
7 |
{ |
{ |
8 |
local command="$1" |
local command="${CLASS_ARGV[0]}" |
9 |
local service="$2" |
local service="${CLASS_ARGV[1]}" |
10 |
local opts="$3" |
local opts="${CLASS_ARGV[2]}" |
11 |
|
|
12 |
[[ -z ${command} ]] && help_system_service && return 1 |
[[ -z ${command} ]] && help_system_service && return 1 |
13 |
[[ -z ${service} ]] && help_system_service && return 1 |
[[ -z ${service} ]] && help_system_service && return 1 |
26 |
|
|
27 |
if [[ -n $(${chrooted} systemctl status ${service} | grep 'Reason: No such file or directory') ]] |
if [[ -n $(${chrooted} systemctl status ${service} | grep 'Reason: No such file or directory') ]] |
28 |
then |
then |
29 |
eecho "Service '${service}' unkown!" |
eecho "Service '${service}' unknown!" |
30 |
return 1 |
return 1 |
31 |
fi |
fi |
32 |
|
|
50 |
|
|
51 |
get_system_service() |
get_system_service() |
52 |
{ |
{ |
53 |
local command="$1" |
local command="${CLASS_ARGV[0]}" |
54 |
local service="$2" |
local service="${CLASS_ARGV[1]}" |
55 |
|
|
56 |
[[ -z ${command} ]] && help_system_service && return 1 |
[[ -z ${command} ]] && help_system_service && return 1 |
57 |
[[ -z ${service} ]] && help_system_service && return 1 |
[[ -z ${service} ]] && help_system_service && return 1 |
70 |
|
|
71 |
if [[ -n $(${chrooted} systemctl status ${service} | grep 'Reason: No such file or directory') ]] |
if [[ -n $(${chrooted} systemctl status ${service} | grep 'Reason: No such file or directory') ]] |
72 |
then |
then |
73 |
eecho "Service '${service}' unkown!" |
eecho "Service '${service}' unknown!" |
74 |
return 1 |
return 1 |
75 |
fi |
fi |
76 |
|
|
77 |
case "${command}" in |
case "${command}" in |
78 |
status) ${chrooted} systemctl status "${service}" ;; |
status) ${chrooted} systemctl status "${service}" ;; |
79 |
enabled) ${chrooted} systemctl is-enabled "${service}"; rvecho "$?" ;; |
enabled) ${chrooted} systemctl is-enabled "${service}"; rvecho "$?" ;; |
80 |
runlevel) rvecho "$(readline ${MROOT}/etc/systemd/system/default.target)" ;; |
runlevel) rvecho "$(readline ${MROOT}@@SYSTEMDSYSTEMCONFDIR@@/default.target)" ;; |
81 |
*) help_system_service && return ;; |
*) help_system_service && return ;; |
82 |
esac |
esac |
83 |
} |
} |