Commit fd6c5101 authored by Ad Schellevis's avatar Ad Schellevis

(firmware) add check for reboot to check update script

parent b7f53fc2
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
# Variables used # Variables used
connection="error" connection="error"
repository="error" repository="error"
upgrade_needs_reboot="0"
updates="" updates=""
core_version="" core_version=""
pkg_running="" pkg_running=""
...@@ -122,6 +123,9 @@ if [ "$pkg_running" == "" ]; then ...@@ -122,6 +123,9 @@ if [ "$pkg_running" == "" ]; then
if [ "$download_size" == "" ]; then if [ "$download_size" == "" ]; then
download_size="none" download_size="none"
fi fi
upgrade_needs_reboot=`pkg upgrade -nq os-update | grep UPGRADED | wc -l | awk '{print $1;}'`
# First check if there are new packages that need to be installed # First check if there are new packages that need to be installed
for i in $(cat $tmp_pkg_output_file); do for i in $(cat $tmp_pkg_output_file); do
if [ "$itemcount" -gt "$linecount" ]; then if [ "$itemcount" -gt "$linecount" ]; then
...@@ -229,7 +233,7 @@ if [ "$pkg_running" == "" ]; then ...@@ -229,7 +233,7 @@ if [ "$pkg_running" == "" ]; then
# Get date/timestamp # Get date/timestamp
last_check=`date` last_check=`date`
# Write our json structure to disk # Write our json structure to disk
echo "{\"connection\":\"$connection\",\"repository\":\"$repository\",\"last_check\":\"$last_check\",\"updates\":\"$updates\",\"core_version\":\"$core_version\",\"download_size\":\"$download_size\",\"extra_space_required\":\"$required_space\",\"new_packages\":[$packages_new],\"reinstall_packages\":[$packages_reinstall],\"upgrade_packages\":[$packages_upgraded]}" > $package_json_output echo "{\"connection\":\"$connection\",\"repository\":\"$repository\",\"last_check\":\"$last_check\",\"updates\":\"$updates\",\"core_version\":\"$core_version\",\"download_size\":\"$download_size\",\"extra_space_required\":\"$required_space\",\"new_packages\":[$packages_new],\"reinstall_packages\":[$packages_reinstall],\"upgrade_packages\":[$packages_upgraded],\"upgrade_needs_reboot\":\"$upgrade_needs_reboot\"}" > $package_json_output
else else
# pkg is already running, quitting # pkg is already running, quitting
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment