change hostname button
This commit is contained in:
13
server.py
13
server.py
@@ -307,7 +307,16 @@ def wifi():
|
||||
os.system('wpa_cli -i wlan0 reconfigure')
|
||||
return index()
|
||||
|
||||
@app.route("/hostname", methods = ['PUT', 'POST', 'GET'])
|
||||
def hostname():
|
||||
data= request.data.decode('utf-8')
|
||||
settings = json.loads(data)
|
||||
hostname = settings['hostname']
|
||||
print('hostname', hostname)
|
||||
os.system("sudo hostnamectl set-hostname {}".format(hostname))
|
||||
os.system("sudo systemctl restart avahi-daemon")
|
||||
|
||||
return index()
|
||||
|
||||
|
||||
@app.route("/screensaver", methods = ['PUT', 'POST'])
|
||||
@@ -477,6 +486,10 @@ def save_message_settings(input_settings):
|
||||
def shutdown():
|
||||
os.system("sudo shutdown now")
|
||||
return index()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@app.route("/matrix")
|
||||
def matrix():
|
||||
|
Reference in New Issue
Block a user