File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -177,8 +177,9 @@ def resetDefaultPrograms():
177
177
q = p .read ()
178
178
programs .insert (json .loads (q ))
179
179
180
- def uploadFile ():
180
+ def updateFromPackage ():
181
+ os .system ('sudo bash /home/pi/clean-update.sh' )
181
182
file_to_upload = connexion .request .files ['file_to_upload' ]
182
- file_to_upload .save (os .path .join ('updatePackages ' , file_to_upload . filename ))
183
- os .system ('sudo coderbot_update updatePackages/' + file_to_upload . filename )
183
+ file_to_upload .save (os .path .join ('/home/pi/ ' , 'update.tar' ))
184
+ os .system ('sudo coderbot_update /home/pi/update.tar && sudo reboot' )
184
185
return 200
Original file line number Diff line number Diff line change 74
74
description : " ok"
75
75
400 :
76
76
description : " Failed to save the activity"
77
- /uploadFile :
77
+ /updateFromPackage :
78
78
post :
79
- operationId : " api.uploadFile "
79
+ operationId : " api.updateFromPackage "
80
80
consumes :
81
81
- multipart/form-data
82
82
parameters :
You can’t perform that action at this time.
0 commit comments