mirror of
https://github.com/tnodir/fort
synced 2024-11-15 07:57:24 +00:00
UI: --boot unregisters booted provider only.
This commit is contained in:
parent
94b1ded272
commit
9fbe90e1f9
@ -165,11 +165,6 @@ bool FortCommon::confAppBlocked(const void *drvConf, int appIndex)
|
|||||||
return fort_conf_app_blocked(conf, appIndex);
|
return fort_conf_app_blocked(conf, appIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint FortCommon::provRegister(bool isBoot)
|
|
||||||
{
|
|
||||||
return fort_prov_register(isBoot);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FortCommon::provUnregister()
|
void FortCommon::provUnregister()
|
||||||
{
|
{
|
||||||
fort_prov_unregister();
|
fort_prov_unregister();
|
||||||
|
@ -55,7 +55,6 @@ public:
|
|||||||
static quint8 confAppGroupIndex(const void *drvConf, int appIndex);
|
static quint8 confAppGroupIndex(const void *drvConf, int appIndex);
|
||||||
static bool confAppBlocked(const void *drvConf, int appIndex);
|
static bool confAppBlocked(const void *drvConf, int appIndex);
|
||||||
|
|
||||||
static uint provRegister(bool isBoot);
|
|
||||||
static void provUnregister();
|
static void provUnregister();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,8 +12,7 @@
|
|||||||
FortSettings::FortSettings(const QStringList &args,
|
FortSettings::FortSettings(const QStringList &args,
|
||||||
QObject *parent) :
|
QObject *parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
m_hasProvBoot(false),
|
m_hasProvBoot(false)
|
||||||
m_provBoot(false)
|
|
||||||
{
|
{
|
||||||
processArguments(args);
|
processArguments(args);
|
||||||
setupIni();
|
setupIni();
|
||||||
@ -44,7 +43,7 @@ void FortSettings::processArguments(const QStringList &args)
|
|||||||
|
|
||||||
const QCommandLineOption provBootOption(
|
const QCommandLineOption provBootOption(
|
||||||
QStringList() << "b" << "boot",
|
QStringList() << "b" << "boot",
|
||||||
"Block access to network when Fort Firewall is not running.", "boot");
|
"Unblock access to network when Fort Firewall is not running.", "boot");
|
||||||
parser.addOption(provBootOption);
|
parser.addOption(provBootOption);
|
||||||
|
|
||||||
const QCommandLineOption profileOption(
|
const QCommandLineOption profileOption(
|
||||||
@ -58,9 +57,6 @@ void FortSettings::processArguments(const QStringList &args)
|
|||||||
parser.process(args);
|
parser.process(args);
|
||||||
|
|
||||||
m_hasProvBoot = parser.isSet(provBootOption);
|
m_hasProvBoot = parser.isSet(provBootOption);
|
||||||
if (m_hasProvBoot) {
|
|
||||||
m_provBoot = QVariant(parser.value(provBootOption)).toBool();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_profilePath = parser.value(profileOption);
|
m_profilePath = parser.value(profileOption);
|
||||||
if (m_profilePath.isEmpty()) {
|
if (m_profilePath.isEmpty()) {
|
||||||
|
@ -28,7 +28,6 @@ public:
|
|||||||
QObject *parent = nullptr);
|
QObject *parent = nullptr);
|
||||||
|
|
||||||
bool hasProvBoot() const { return m_hasProvBoot; }
|
bool hasProvBoot() const { return m_hasProvBoot; }
|
||||||
bool provBoot() const { return m_provBoot; }
|
|
||||||
|
|
||||||
bool debug() const { return iniBool("base/debug"); }
|
bool debug() const { return iniBool("base/debug"); }
|
||||||
void setDebug(bool on) { setIniValue("base/debug", on); }
|
void setDebug(bool on) { setIniValue("base/debug", on); }
|
||||||
@ -104,7 +103,6 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
uint m_hasProvBoot : 1;
|
uint m_hasProvBoot : 1;
|
||||||
uint m_provBoot : 1;
|
|
||||||
|
|
||||||
QString m_profilePath;
|
QString m_profilePath;
|
||||||
|
|
||||||
|
@ -19,11 +19,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
FortSettings fortSettings(qApp->arguments());
|
FortSettings fortSettings(qApp->arguments());
|
||||||
|
|
||||||
// Register booted provider and exit
|
// Unregister booted provider and exit
|
||||||
if (fortSettings.hasProvBoot()) {
|
if (fortSettings.hasProvBoot()) {
|
||||||
FortCommon::provUnregister();
|
FortCommon::provUnregister();
|
||||||
return fortSettings.provBoot()
|
return 0;
|
||||||
? FortCommon::provRegister(true) : 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// To check running instance
|
// To check running instance
|
||||||
|
Loading…
Reference in New Issue
Block a user