.
This commit is contained in:
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -11,5 +11,7 @@
|
|||||||
"--load-plugins",
|
"--load-plugins",
|
||||||
"pylint_flask_sqlalchemy",
|
"pylint_flask_sqlalchemy",
|
||||||
"pylint_flask",
|
"pylint_flask",
|
||||||
|
"--disable",
|
||||||
|
"bare-except,invalid-name"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -132,7 +132,7 @@ def connect_network(ssid, security, password):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def disconnect_network(ssid):
|
def disconnect_network():
|
||||||
run_subprocess_interface("sudo /usr/sbin/ifdown {}")
|
run_subprocess_interface("sudo /usr/sbin/ifdown {}")
|
||||||
|
|
||||||
with open("/etc/wpa_supplicant/wpa_supplicant.conf", "wt") as f:
|
with open("/etc/wpa_supplicant/wpa_supplicant.conf", "wt") as f:
|
||||||
|
|||||||
@@ -62,10 +62,10 @@ def connectwpa(ssid):
|
|||||||
return render_template("wpa.html", title="WPA Password", form=form)
|
return render_template("wpa.html", title="WPA Password", form=form)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/disconnect/<string:ssid>", methods=["GET", "POST"])
|
@app.route("/disconnect/", methods=["GET", "POST"])
|
||||||
@login_required
|
@login_required
|
||||||
def disconnect(ssid):
|
def disconnect(ssid):
|
||||||
if disconnect_network(ssid):
|
if disconnect_network():
|
||||||
return render_template("message.html", message="Sucessfully disconnected from {}".format(ssid))
|
return render_template("message.html", message="Sucessfully disconnected from {}".format(ssid))
|
||||||
|
|
||||||
return render_template("message.html", message="Failt to disconnect from {}".format(ssid))
|
return render_template("message.html", message="Failt to disconnect from {}".format(ssid))
|
||||||
|
|||||||
Reference in New Issue
Block a user