Commit c2d49d86 authored by christian's avatar christian Committed by osak buildhauer user
Browse files

added Firewall chooser

chooseFirewall will ask the user if he wants to enable the Firewall an will enable it if the answer is yes, no action are taken if the answer is no
parent 9f29988a
...@@ -142,6 +142,15 @@ def showErrorBox(errorstring): ...@@ -142,6 +142,15 @@ def showErrorBox(errorstring):
errorBox.setIcon(3) errorBox.setIcon(3)
sys.exit(errorBox.exec_()) sys.exit(errorBox.exec_())
def chooseFirewall():
askBox = QtWidgets.QMessageBox()
askBox.setText("Netzwerk: Soll die Ubuntu Firewall (ufw/gufw) aktiviert werden?")
askBox.setStandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
result = askBox.exec_()
if result == QtWidgets.QMessageBox.Yes:
def checkIfRoot(): def checkIfRoot():
if os.getuid() != 0: if os.getuid() != 0:
errorBox = QtWidgets.QMessageBox() errorBox = QtWidgets.QMessageBox()
...@@ -167,6 +176,10 @@ def installPackages(strlist): ...@@ -167,6 +176,10 @@ def installPackages(strlist):
except Exception as ex: except Exception as ex:
print("Error during install",ex) print("Error during install",ex)
def enableFirewall():
command=['ufw', 'enable']
def mountStick(): def mountStick():
command=[basedir+"/"] command=[basedir+"/"]
subprocess_wrap(command) subprocess_wrap(command)
...@@ -246,6 +259,7 @@ if __name__ == '__main__': ...@@ -246,6 +259,7 @@ if __name__ == '__main__':
basepath=os.path.realpath(__file__) basepath=os.path.realpath(__file__)
basedir=os.path.dirname(basepath) basedir=os.path.dirname(basepath)
checkIfRoot() checkIfRoot()
mountStick() mountStick()
window = Main() window = Main()
window.setWindowTitle("Linux Install Party Software Installer") window.setWindowTitle("Linux Install Party Software Installer")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment