35 lines
699 B
C++
35 lines
699 B
C++
//
|
|
// 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
|