added JSON support to select the services
This commit is contained in:
34
src/systemd.h
Normal file
34
src/systemd.h
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Created by lukas on 5/11/25.
|
||||
//
|
||||
|
||||
#ifndef SYSTEMD_H
|
||||
#define SYSTEMD_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace systemd {
|
||||
/**
|
||||
* Check if a service is active
|
||||
* @param service_name name of the systemd service
|
||||
* @return
|
||||
*/
|
||||
bool is_service_active(std::string_view service_name);
|
||||
|
||||
/**
|
||||
* Check if a service is enabled
|
||||
* @param service_name name of the systemd service
|
||||
* @return
|
||||
*/
|
||||
bool is_service_enabled(std::string_view service_name);
|
||||
|
||||
/**
|
||||
* Toggle the service on or off dependent on its current state
|
||||
* @param service_name name of the systemd service
|
||||
*/
|
||||
void toggle_service(std::string_view service_name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif //SYSTEMD_H
|
||||
Reference in New Issue
Block a user