Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
915f04b3
Commit
915f04b3
authored
Apr 11, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firmware: embed the base system upgrade into the GUI flow
parent
3505b042
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
pkg_upgrade.sh
src/opnsense/scripts/pkg_upgrade.sh
+14
-4
system_firmware_check.php
src/www/system_firmware_check.php
+5
-4
No files found.
src/opnsense/scripts/pkg_upgrade.sh
View file @
915f04b3
...
...
@@ -29,6 +29,7 @@ package=$1
pkg_running
=
`
ps
-x
|
grep
"pkg "
|
grep
-v
"grep"
|
grep
-v
"pkg_upgrade.sh"
`
PKG_PROGRESS_FILE
=
/tmp/pkg_upgrade.progress
REBOOT
=
# Truncate upgrade progress file
:
>
${
PKG_PROGRESS_FILE
}
...
...
@@ -40,10 +41,15 @@ if [ -z "$pkg_running" ]; then
if
[
"
$package
"
==
"all"
]
;
then
# update all installed packages
pkg upgrade
-y
>>
${
PKG_PROGRESS_FILE
}
# restart the web server
/usr/local/opnsense/service/configd_ctl.py
'webgui restart'
>>
${
PKG_PROGRESS_FILE
}
# remove no longer referenced packages
pkg autoremove
-y
>>
${
PKG_PROGRESS_FILE
}
# restart the web server
/usr/local/etc/rc.restart_webgui
>>
${
PKG_PROGRESS_FILE
}
# if we can update base, we'll do that as well
if
opnsense-update
-c
;
then
if
opnsense-update
>>
${
PROGRESS_FILE
}
;
then
REBOOT
=
1
fi
fi
elif
[
"
$package
"
==
"pkg"
]
;
then
pkg upgrade
-y
$package
>>
${
PKG_PROGRESS_FILE
}
else
...
...
@@ -55,4 +61,8 @@ else
echo
'Upgrade already in progress'
>>
${
PKG_PROGRESS_FILE
}
fi
echo
'***DONE***'
>>
${
PKG_PROGRESS_FILE
}
if
[
-n
"
${
REBOOT
}
"
]
;
then
echo
'***REBOOT***'
>>
${
PKG_PROGRESS_FILE
}
else
echo
'***DONE***'
>>
${
PKG_PROGRESS_FILE
}
fi
src/www/system_firmware_check.php
View file @
915f04b3
...
...
@@ -247,7 +247,6 @@ include("head.inc");
}
function
updatestatus
()
{
jQuery
.
ajax
({
type
:
"POST"
,
url
:
'/system_firmware_check.php'
,
...
...
@@ -255,10 +254,12 @@ include("head.inc");
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
jQuery
(
'#output'
)
.
prop
(
'innerHTML'
,
data
);
document
.
getElementById
(
"output"
)
.
scrollTop
=
document
.
getElementById
(
"output"
)
.
scrollHeight
;
if
(
data
.
indexOf
(
'***DONE***'
)
<
0
)
{
setTimeout
(
function
()
{
updatestatus
();
},
500
);
if
(
data
.
indexOf
(
'***REBOOT***'
)
>=
0
)
{
jQuery
(
'#updatestatus'
)
.
html
(
'<span class="text-info">Upgrade done! A reboot is erquired.</span><br/>'
);
if
(
data
.
indexOf
(
'***DONE***'
)
>=
0
)
{
jQuery
(
'#updatestatus'
)
.
html
(
'<a href="/system_firmware_check.php"><span class="btn btn-primary btn-xs">Check to refresh</span></a> <span class="text-info">Upgrade done!</span><br/>'
);
}
else
{
jQuery
(
'#updatestatus'
)
.
html
(
'<a href="/system_firmware_check.php"><span class="btn btn-primary btn-xs">Check to refresh</span></a> <span class="text-info">Upgrade Done!</span><br/>'
);
setTimeout
(
function
()
{
updatestatus
();
},
500
);
}
}
});
...
...
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