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
1fd22b65
Commit
1fd22b65
authored
Apr 01, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firmware: polish the upgrade script
parent
8d774567
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
pkg_upgrade.sh
src/opnsense/scripts/pkg_upgrade.sh
+13
-11
No files found.
src/opnsense/scripts/pkg_upgrade.sh
View file @
1fd22b65
...
@@ -33,24 +33,26 @@ PKG_PROGRESS_FILE=/tmp/pkg_upgrade.progress
...
@@ -33,24 +33,26 @@ PKG_PROGRESS_FILE=/tmp/pkg_upgrade.progress
# Truncate upgrade progress file
# Truncate upgrade progress file
:
>
${
PKG_PROGRESS_FILE
}
:
>
${
PKG_PROGRESS_FILE
}
echo
"***GOT REQUEST TO UPGRADE:
$package
***"
>>
${
PKG_PROGRESS_FILE
}
if
[
-z
"
$pkg_running
"
]
;
then
if
[
-z
"
$pkg_running
"
]
;
then
echo
"***GOT REQUEST TO UPGRADE:
$package
***"
>>
${
PKG_PROGRESS_FILE
}
if
[
"
$package
"
==
"all"
]
;
then
echo
'***STARTING UPGRADE***'
>>
${
PKG_PROGRESS_FILE
}
echo
'***STARTING UPGRADE***'
>>
${
PKG_PROGRESS_FILE
}
if
[
"
$package
"
==
"all"
]
;
then
# update all installed packages
pkg upgrade
-y
>>
${
PKG_PROGRESS_FILE
}
pkg upgrade
-y
>>
${
PKG_PROGRESS_FILE
}
else
# restart the web server
# XXX this is dangerous and not recommended by pkgng devs
/usr/local/opnsense/service/configd_ctl.py
'service restart webgui'
>>
${
PKG_PROGRESS_FILE
}
echo
'***STARTING UPGRADE - ONE PACKAGE***'
>>
${
PKG_PROGRESS_FILE
}
# remove no longer referenced packages
pkg autoremove
-y
>>
${
PKG_PROGRESS_FILE
}
elif
[
"
$package
"
==
"pkg"
]
;
then
pkg upgrade
-y
$package
>>
${
PKG_PROGRESS_FILE
}
pkg upgrade
-y
$package
>>
${
PKG_PROGRESS_FILE
}
else
echo
"Cannot update
$package
"
>>
${
PKG_PROGRESS_FILE
}
fi
fi
echo
'***CHECKING FOR MORE UPGRADES, CAN TAKE 30 SECONDS***'
>>
${
PKG_PROGRESS_FILE
}
echo
'***CHECKING FOR MORE UPGRADES, CAN TAKE 30 SECONDS***'
>>
${
PKG_PROGRESS_FILE
}
/usr/local/opnsense/scripts/pkg_updatecheck.sh
/usr/local/opnsense/scripts/pkg_updatecheck.sh
# remove no longer referenced packages
pkg autoremove
-y
>>
${
PKG_PROGRESS_FILE
}
# restart the web server
/usr/local/opnsense/service/configd_ctl.py
'service restart webgui'
>>
${
PKG_PROGRESS_FILE
}
echo
'***DONE***'
>>
${
PKG_PROGRESS_FILE
}
else
else
echo
'Upgrade already in progress'
>>
${
PKG_PROGRESS_FILE
}
echo
'Upgrade already in progress'
>>
${
PKG_PROGRESS_FILE
}
echo
'***DONE***'
>>
${
PKG_PROGRESS_FILE
}
fi
fi
echo
'***DONE***'
>>
${
PKG_PROGRESS_FILE
}
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