Skip to content

Commit 313bf19

Browse files
Allow forced update
/update/force now initates update from webbrowser and any output is logged to syslog as forced_update
1 parent 7fca2c5 commit 313bf19

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

frame.py

+8
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,14 @@ def show_error(e):
152152
'''
153153
return message, code
154154

155+
@app.route('/update/force', methods=['GET'])
156+
def force_update():
157+
if os.path.exists('/root/photoframe/update.sh'):
158+
p = subprocess.Popen('/bin/bash /root/photoframe/update.sh 2>&1 | logger -t forced_update', shell=True)
159+
return 'Update in process', 200
160+
else:
161+
return 'Cannot find update tool', 404
162+
155163
@app.route('/debug', methods=['GET'], defaults={'all' : False})
156164
@app.route('/debug/all', methods=['GET'], defaults={'all' : True})
157165
def show_logs(all):

0 commit comments

Comments
 (0)