Skip to content

Commit

Permalink
move service restart after the new release number injection.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefal committed Jun 19, 2024
1 parent 3fa2484 commit 3cee11d
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions rtkbase_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,20 +192,14 @@ upd_2.5.0 () {
upgrade_rtklib
#remove sbas rtcm message
sed -i -r '/^rtcm_/s/1107(\([0-9]+\))?,//' "${destination_directory}"/settings.conf
#restart str2str if it was active before upgrading rtklib
[ $str2str_active = 'active' ] && systemctl start str2str_tcp
# restart previously running services
[ $str2str_ntrip_A_active = 'active' ] && systemctl start str2str_ntrip_A
[ $str2str_ntrip_B_active = 'active' ] && systemctl start str2str_ntrip_B
[ $str2str_local_caster = 'active' ] && systemctl start str2str_local_ntrip_caster
[ $str2str_rtcm = 'active' ] && systemctl start str2str_rtcm_svr
[ $str2str_serial = 'active' ] && systemctl start str2str_rtcm_serial
[ $str2str_file = 'active' ] && systemctl start str2str_file
[ $rtkrcv_raw2nmea = 'active' ] && systemctl start rtkbase_raw2nmea
return 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() {
upd_2.5.0
}

#check if we can apply the update
#FOR THE OLDER ME -> Don't forget to modify the os detection if there is a 2.5.x release !!!
[[ $checking == '--checking' ]] && check_before_update && exit
Expand All @@ -230,8 +224,22 @@ sed -i '/^\[general\]/a updated=true' ${destination_directory}/settings.conf
#change rtkbase's content owner
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
# 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
[ $str2str_ntrip_B_active = 'active' ] && systemctl restart str2str_ntrip_B
[ $str2str_local_caster = 'active' ] && systemctl restart str2str_local_ntrip_caster
[ $str2str_rtcm = 'active' ] && systemctl restart str2str_rtcm_svr
[ $str2str_serial = 'active' ] && systemctl restart str2str_rtcm_serial


#if a reboot is needed
#systemctl reboot

echo "Restart web server"
echo 'RTKBase update ending...'
echo 'Restart web server'
systemctl restart rtkbase_web.service

0 comments on commit 3cee11d

Please sign in to comment.