Implement sytemctl actions
This commit is contained in:
parent
ce4de34d5a
commit
bcf0b56911
1 changed files with 40 additions and 0 deletions
40
ordo/action/systemcl.scm
Normal file
40
ordo/action/systemcl.scm
Normal file
|
@ -0,0 +1,40 @@
|
|||
#|
|
||||
This file is part of Ordo.
|
||||
|
||||
Copyright (C) 2025 Ray Miller
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
Foundation, version 3.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|#
|
||||
|
||||
(define-module (ordo action systemctl)
|
||||
#:use-module (ordo connection)
|
||||
#:export (daemon-reload stop start restart reload))
|
||||
|
||||
(define (daemon-reload conn #:key user?)
|
||||
(remote-cmd conn "systemctl" (when user? "--user") "daemon-reload" #:check? #t)
|
||||
#t)
|
||||
|
||||
(define (stop conn #:key unit user?)
|
||||
(remote-cmd conn "systemctl" (when user? "--user") "stop" unit #:check? #t)
|
||||
#t)
|
||||
|
||||
(define (start conn #:key unit user?)
|
||||
(remote-cmd conn "systemctl" (when user? "--user") "start" unit #:check? #t)
|
||||
#t)
|
||||
|
||||
(define (reload conn #:key unit user?)
|
||||
(remote-cmd conn "systemctl" (when user? "--user") "reload" unit #:check? #t)
|
||||
#t)
|
||||
|
||||
(define (restart conn #:key unit user?)
|
||||
(remote-cmd conn "systemctl" (when user? "--user") "restart" unit #:check? #t)
|
||||
#t)
|
Loading…
Add table
Add a link
Reference in a new issue