Skip to content

Commit

Permalink
Allow forced update
Browse files Browse the repository at this point in the history
/update/force now initates update from webbrowser and any output
is logged to syslog as forced_update
  • Loading branch information
Tester-Testsson committed Jul 23, 2018
1 parent 7fca2c5 commit 313bf19
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ def show_error(e):
'''
return message, code

@app.route('/update/force', methods=['GET'])
def force_update():
if os.path.exists('/root/photoframe/update.sh'):
p = subprocess.Popen('/bin/bash /root/photoframe/update.sh 2>&1 | logger -t forced_update', shell=True)
return 'Update in process', 200
else:
return 'Cannot find update tool', 404

@app.route('/debug', methods=['GET'], defaults={'all' : False})
@app.route('/debug/all', methods=['GET'], defaults={'all' : True})
def show_logs(all):
Expand Down

0 comments on commit 313bf19

Please sign in to comment.