Skip to content

Commit 82923d9

Browse files
committed
update scripts
1 parent 4611f12 commit 82923d9

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

main.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,14 @@ def handle_wifi():
9292

9393
@app.route("/update", methods=["GET"])
9494
def handle_update():
95-
out = subprocess.check_output((["./update_os.sh"],
96-
stderr=subprocess.STDOUT)
97-
logging.info(out)
95+
logging.info("updating system.1")
96+
out = subprocess.check_output(["./scripts/update_os.sh"],
97+
stderr=subprocess.STDOUT)
98+
logging.info("updating system.2: " + str(out))
9899

99-
out = subprocess.check_output((["./update_coderbot.sh"],
100+
out = subprocess.check_output(["./scripts/update_coderbot.sh"],
100101
stderr=subprocess.STDOUT)
101-
logging.info(out)
102+
logging.info("updating system.3: " + str(out))
102103

103104
@app.route("/bot", methods=["GET"])
104105
def handle_bot():

scripts/update_coderbot.sh

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#!/bin/sh
12
git pull origin develop

scripts/update_os.sh

100644100755
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
#!/bin/sh
12
sudo rpi-update
2-
sudo apt-get update
3-
sudo apt-get upgrade
3+
sudo apt-get update -qy
4+
sudo apt-get upgrade -qy
45

static/js/control.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ $(document).on( "pagecreate", '#page-preferences', function( event ) {
162162
bot.reboot();
163163
}
164164
});
165+
$('#b_update').on("click", function (){
166+
if(confirm("Update System? (this requires a internet connection and will takes a few minutes).")){
167+
$.get(url='/update');
168+
}
169+
});
165170
});
166171

167172
$(document).on( "pageshow", '#page-photos', function( event ) {

templates/config.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ <h1>CoderBot</h1>
159159
<button id="b_halt" class="ui-btn ui-btn-inline ui-shadow ui-corner-all ui-btn-icon-left ui-icon-power" type="button">{% trans %}Halt{% endtrans %}</button>
160160
<button id="b_restart" class="ui-btn ui-btn-inline ui-shadow ui-corner-all ui-btn-icon-left ui-icon-refresh" type="button">{% trans %}Restart{% endtrans %}</button>
161161
<button id="b_reboot" class="ui-btn ui-btn-inline ui-shadow ui-corner-all ui-btn-icon-left ui-icon-alert" type="button">{% trans %}Reboot{% endtrans %}</button>
162+
<button id="b_update" class="ui-btn ui-btn-inline ui-shadow ui-corner-all ui-btn-icon-left ui-icon-alert" type="button">{% trans %}Update System{% endtrans %}</button>
162163
</div>
163164
<div class="ui-grid-a">
164165
<div class="ui-block-a"><a href="#" data-rel="close" class="ui-btn ui-shadow ui-corner-all ui-btn-b ui-mini">{% trans %}Cancel{% endtrans %}</a></div>

0 commit comments

Comments
 (0)