Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
80f773b6
Commit
80f773b6
authored
Sep 04, 2018
by
Benoit Rat
Committed by
Adam Wujek
Apr 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
www: fix PHP internal error (500) while flashing
parent
d190fa5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
functions.php
userspace/rootfs_override/var/www/functions.php
+4
-2
No files found.
userspace/rootfs_override/var/www/functions.php
View file @
80f773b6
...
...
@@ -778,6 +778,8 @@ function wrs_management(){
if
(
!
strcmp
(
$cmd
,
"reboot"
)){
wrs_reboot
();
}
else
if
(
!
empty
(
$_FILES
[
'firmware'
][
'name'
])){
shell_exec
(
"rm /tmp/wrs-firmware.tar"
);
//Clean previously uploaded files
shell_exec
(
"rm /tmp/wr-switch-sw-v*_binaries.tar"
);
//Clean previously uploaded files
$uploaddir
=
'/tmp/'
;
$uploadfname
=
basename
(
$_FILES
[
'firmware'
][
'name'
]);
$uploadfile
=
$uploaddir
.
$uploadfname
;
...
...
@@ -786,14 +788,14 @@ function wrs_management(){
echo
'<p align=center ><font color="red"><br>Upgrade procedure will take place after reboot.<br>Please do not switch off the device during flashing procedure.</font></p>'
;
if
(
$uploadfname
==
"barebox.bin"
||
$uploadfname
==
"wrs-firmware.tar"
||
$uploadfname
==
"zImage"
)
{
rename
(
$uploadfile
,
"
/update/"
.
(
$_FILES
[
'firmware'
][
'name'
]));
shell_exec
(
"mv -f
$uploadfile
/update/"
.
(
$_FILES
[
'firmware'
][
'name'
]));
//Reboot switch
sleep
(
1
);
wrs_reboot
(
90
);
//Updating only one part of the firmware take ~90s.
}
else
if
(
substr
(
$uploadfname
,
0
,
14
)
==
"wr-switch-sw-v"
&&
substr
(
$uploadfname
,
-
13
)
==
"_binaries.tar"
)
{
rename
(
$uploadfile
,
"
/update/wrs-firmware.tar"
);
shell_exec
(
"mv -f
$uploadfile
/update/wrs-firmware.tar"
);
//Reboot switch
sleep
(
1
);
wrs_reboot
(
150
);
//120s should be enough but we prefer to keep safe
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment