Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit Switch - Software
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Projects
White Rabbit Switch - Software
Commits
df5ce92a
Commit
df5ce92a
authored
6 years ago
by
Benoit Rat
Browse files
Options
Downloads
Patches
Plain Diff
www: fix PHP internal error (500) while flashing
parent
2a4bbad9
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Ben 190405 wrdate fixes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
userspace/rootfs_override/var/www/functions.php
+4
-2
4 additions, 2 deletions
userspace/rootfs_override/var/www/functions.php
with
4 additions
and
2 deletions
userspace/rootfs_override/var/www/functions.php
+
4
−
2
View file @
df5ce92a
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment