11 |
{ |
{ |
12 |
local command="$1" |
local command="$1" |
13 |
local service="$2" |
local service="$2" |
14 |
|
local argv="$3" |
15 |
local chrooted |
local chrooted |
16 |
|
|
17 |
if [[ -n ${MROOT} ]] && [[ ${MROOT} != / ]] |
if [[ -n ${MROOT} ]] && [[ ${MROOT} != / ]] |
39 |
fi |
fi |
40 |
|
|
41 |
case "${command}" in |
case "${command}" in |
42 |
start) ${chrooted} systemctl start "${service}" ;; |
start) ${chrooted} systemctl start "${service}" "${argv}" ;; |
43 |
stop) ${chrooted} systemctl stop "${service}" ;; |
stop) ${chrooted} systemctl stop "${service}" "${argv}" ;; |
44 |
#restart) ${chrooted} systemctl try-restart "${service}" ;; |
#restart) ${chrooted} systemctl try-restart "${service}" "${argv}" ;; |
45 |
restart) ${chrooted} systemctl restart "${service}" ;; |
restart) ${chrooted} systemctl restart "${service}" "${argv}" ;; |
46 |
reload) ${chrooted} systemctl reload-or-try-restart "${service}" ;; |
reload) ${chrooted} systemctl reload-or-try-restart "${service}" "${argv}" ;; |
47 |
enable) ${chrooted} systemctl enable "${service}" ;; |
enable) ${chrooted} systemctl enable "${service}" "${argv}" ;; |
48 |
disable) ${chrooted} systemctl disable "${service}" ;; |
disable) ${chrooted} systemctl disable "${service}" "${argv}" ;; |
49 |
status) ${chrooted} systemctl status "${service}" ;; |
status) ${chrooted} systemctl status "${service}" "${argv}" ;; |
50 |
enabled) ${chrooted} systemctl is-enabled "${service}"; rvecho "$?" ;; |
enabled) ${chrooted} systemctl is-enabled "${service}"; rvecho "$?" ;; |
51 |
runlevel) rvecho "$(readline ${MROOT}@@SYSTEMDSYSTEMCONFDIR@@/default.target)" ;; |
runlevel) rvecho "$(readline ${MROOT}@@SYSTEMDSYSTEMCONFDIR@@/default.target)" ;; |
52 |
*) return 1 ;; |
*) return 1 ;; |