Skip to content

Commit

Permalink
Insert new release into settings.conf before restarting services
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefal committed Jul 18, 2024
1 parent cfad198 commit 706fe3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
### Deprecated
### Removed
### Fixed
- Insert new release into settings.conf before restarting services. #411
- Cellular modem: nmcli connection was not updated after a switch to public ip address.
### Security

Expand Down
14 changes: 7 additions & 7 deletions tools/rtkbase_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ upd_2.5.0 () {

}

#this update function is here only for testing update, but could be useful in case of a failed 2.5 to 2.6 update.
upd_2.6.0() {
"${destination_directory}"/tools/install.sh --user "${standard_user}" --unit-files
}
Expand All @@ -219,9 +218,10 @@ upd_"${old_version/b*/b}" "$@" || { echo 'Update failed (upd_release_number)' ;
#When dealing with beta version, "${oldversion/b*/b}" will call function 2.4b when we use a release 2.4b1 or 2.4b2 or 2.4beta99

# The new version numbers will be imported from settings.conf.default during the web server startup.
echo "Delete the line version= and checkpoint_version= in settings.conf"
echo "update the line version= and delete checkpoint_version= in settings.conf"
sed -i '/^checkpoint_version=/d' ${destination_directory}/settings.conf
sed -i '/^version=/d' ${destination_directory}/settings.conf
new_version=$(grep '^version' ${destination_directory}/settings.conf.default | awk -F '=' '{ print $2 }')
sed -i 's/^version=.*/version='$new_version'/' ${destination_directory}/settings.conf
echo 'Insert updated status in settings.conf'
sed -i '/^\[general\]/a updated=true' ${destination_directory}/settings.conf

Expand All @@ -230,9 +230,10 @@ chown -R ${standard_user}:${standard_user} ${destination_directory}

#restart str2str if it was active before upgrading rtklib
# restart not nedeed if RTKlib was not upgraded
[ $str2str_active = 'active' ] && systemctl restart str2str_tcp
[ $str2str_file = 'active' ] && systemctl restart str2str_file
[ $rtkrcv_raw2nmea = 'active' ] && systemctl restart rtkbase_raw2nmea
#[ $str2str_active = 'active' ] && systemctl restart str2str_tcp
#[ $str2str_file = 'active' ] && systemctl restart str2str_file
#[ $rtkrcv_raw2nmea = 'active' ] && systemctl restart rtkbase_raw2nmea

# restart previously running services
# restart needed with all update to propagate the release number in the rtcm stream
[ $str2str_ntrip_A_active = 'active' ] && systemctl restart str2str_ntrip_A
Expand All @@ -241,7 +242,6 @@ chown -R ${standard_user}:${standard_user} ${destination_directory}
[ $str2str_rtcm = 'active' ] && systemctl restart str2str_rtcm_svr
[ $str2str_serial = 'active' ] && systemctl restart str2str_rtcm_serial


#if a reboot is needed
#systemctl reboot
echo 'RTKBase update ending...'
Expand Down

1 comment on commit 706fe3f

@Stefal
Copy link
Owner Author

@Stefal Stefal commented on 706fe3f Jul 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should fix #411

Please sign in to comment.