(FreeBSD) Added support for rebooting and powering off from inside ES-DE

This commit is contained in:
Leon Styhre 2024-08-19 17:20:31 +02:00
parent 3f5e277cd6
commit 338843ce46

View file

@ -43,8 +43,8 @@ namespace Utils
{ {
#if defined(_WIN64) #if defined(_WIN64)
return system("shutdown -r -t 0"); return system("shutdown -r -t 0");
#elif defined(__APPLE__) #elif defined(__APPLE__) || defined(__FreeBSD__)
// This will probably never be used as macOS requires root privileges to reboot. // This will probably never be used on macOS as it requires root privileges to reboot.
return system("shutdown -r now"); return system("shutdown -r now");
#else #else
return system("shutdown --reboot now"); return system("shutdown --reboot now");
@ -58,6 +58,8 @@ namespace Utils
#elif defined(__APPLE__) #elif defined(__APPLE__)
// This will probably never be used as macOS requires root privileges to power off. // This will probably never be used as macOS requires root privileges to power off.
return system("shutdown now"); return system("shutdown now");
#elif defined(__FreeBSD__)
return system("shutdown -p now");
#else #else
return system("shutdown --poweroff now"); return system("shutdown --poweroff now");
#endif #endif