From 76a14952f8431172aa045c9f633f6ef4044da5e7 Mon Sep 17 00:00:00 2001 From: PieterGit Date: Thu, 29 Dec 2016 16:58:06 +0100 Subject: [PATCH] append radio_locale to pump.ini for ww pumps temporary workaround for https://github.com/oskarpearson/mmeowlink/issues/55 --- bin/oref0-setup.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/oref0-setup.sh b/bin/oref0-setup.sh index d09927ed0..40924503b 100755 --- a/bin/oref0-setup.sh +++ b/bin/oref0-setup.sh @@ -449,6 +449,10 @@ else if [[ ${radio_locale,,} =~ "WW" ]]; then # add subg-ww-radio-parameters script to mmtune for WW pump. See https://github.com/oskarpearson/mmeowlink/issues/51 or https://github.com/oskarpearson/mmeowlink/wiki/Non-USA-pump-settings for details sed -i"" 's/^\(mmtune.*\); \(echo -n .*mmtune:\)/\1; echo -n subg-ww-radio-parameters:; \/usr\/local\/bin\/oref0-subg-ww-radio-parameters-timeout; \2/g' openaps.ini + + # Hack to check if radio_locale has been set in pump.ini. This is a temporary workaround for https://github.com/oskarpearson/mmeowlink/issues/55 + # It will remove empty line at the end of pump.ini and then append radio_locale if it's not there yet + grep -q radio_locale pump.ini || echo "$(< pump.ini)" > pump.ini ; echo "radio_locale=$radio_locale" >> pump.ini fi fi