added JSON support to select the services

This commit is contained in:
2025-05-27 21:33:15 +02:00
parent d9d0643dfc
commit 1e9a377c2a
19 changed files with 26060 additions and 139 deletions

34
src/systemd.h Normal file
View 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