mirror of
https://github.com/Cronocide/wifipumpkin3.git
synced 2025-01-22 11:18:55 +00:00
fixed logical error when try to get iptables path with nf_tables thanks @cjb900
This commit is contained in:
parent
6c8e5a64ae
commit
d6cf0a80b1
@ -28,6 +28,7 @@ All notable changes to this project will be documented in this file.
|
||||
- fixed wirelesscontroller not started into restAPI mode
|
||||
- fixed locale error in docker container
|
||||
- fixed logical error dhcpd server implementation #158
|
||||
- fixed logical error when try to get iptables path with nf_tables thanks @cjb900
|
||||
|
||||
## [Released]
|
||||
|
||||
|
@ -193,15 +193,25 @@ class Linux(QtCore.QObject):
|
||||
return my_id
|
||||
|
||||
@staticmethod
|
||||
def getBinaryPath(command: str):
|
||||
binary_path = popen("which {}".format(command)).read()
|
||||
def getCommandOutput(command: str):
|
||||
""" get the first line of command executed on bash"""
|
||||
binary_path = popen("{}".format(command)).read()
|
||||
if not binary_path:
|
||||
return ""
|
||||
return binary_path.split("\n")[0]
|
||||
|
||||
@staticmethod
|
||||
def getBinaryPath(binary_name: str):
|
||||
""" get the path of binary linux"""
|
||||
binary_path = popen("which {}".format(binary_name)).read()
|
||||
if not binary_path:
|
||||
return ""
|
||||
return binary_path.split("\n")[0]
|
||||
|
||||
@staticmethod
|
||||
def checkIfIptablesVersion():
|
||||
if "nf_tables" in Linux.getBinaryPath("iptables"):
|
||||
""" check if iptables version is nf_tables """
|
||||
if "nf_tables" in Linux.getCommandOutput("iptables --version"):
|
||||
return Linux.getBinaryPath("iptables-legacy")
|
||||
return Linux.getBinaryPath("iptables")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user