Skip to content
API Documentation
BastionGuard™
FirewallInstaller Class Reference

#include <FirewallInstaller.hpp>

Static Public Member Functions

static std::string getInstallCommand (const std::string &distro, bool preferFirewalld=true)

Detailed Description

Definition at line 26 of file FirewallInstaller.hpp.

Member Function Documentation

◆ getInstallCommand()

std::string FirewallInstaller::getInstallCommand ( const std::string & distro,
bool preferFirewalld = true )
static

Definition at line 23 of file FirewallInstaller.cpp.

26{
27 if (preferFirewalld) {
28 if (distro == "fedora" || distro == "rhel" ||
29 distro == "centos" || distro == "opensuse")
30 return "pkexec dnf install firewalld";
31
32 if (distro == "arch" || distro == "manjaro")
33 return "pkexec pacman -S firewalld";
34 }
35
36 // ufw
37 if (distro == "ubuntu" || distro == "debian")
38 return "pkexec apt install ufw";
39
40 if (distro == "arch" || distro == "manjaro")
41 return "pkexec pacman -S ufw";
42
43 return "";
44}

Referenced by FirewallChoiceDialog::FirewallChoiceDialog().


The documentation for this class was generated from the following files: