From 0239a43be186b8f7f75a36411042e9407a7a6aad Mon Sep 17 00:00:00 2001 From: jelockwood Date: Wed, 20 Feb 2019 13:48:30 +0000 Subject: [PATCH] Fix default value for USE_GECODE preference --- installer_package/postinstall.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/installer_package/postinstall.sh b/installer_package/postinstall.sh index 333bf77..7e48324 100644 --- a/installer_package/postinstall.sh +++ b/installer_package/postinstall.sh @@ -7,6 +7,19 @@ if [ ! -f "/Library/Preferences/com.jelockwood.pinpoint.plist" ]; then /usr/bin/defaults write "/Library/Preferences/com.jelockwood.pinpoint" USE_ALTITUDE -bool FALSE /usr/bin/defaults write "/Library/Preferences/com.jelockwood.pinpoint" USE_GEOCODE -bool TRUE /usr/bin/defaults write "/Library/Preferences/com.jelockwood.pinpoint" YOUR_API_KEY -string "" +else + use_geocode=`/usr/bin/defaults read "/Library/Preferences/com.jelockwood.pinpoint" USE_GEOCODE` + if [ -z "$use_geocode" ]; then + /usr/bin/defaults write "/Library/Preferences/com.jelockwood.pinpoint" USE_GEOCODE -bool TRUE + fi + use_altitude=`/usr/bin/defaults read "/Library/Preferences/com.jelockwood.pinpoint" USE_ALTITUDE` + if [ -z "$use_altitude" ]; then + /usr/bin/defaults write "/Library/Preferences/com.jelockwood.pinpoint" USE_ALTITUDE -bool FALSE + fi + your_api_key=`/usr/bin/defaults read "/Library/Preferences/com.jelockwood.pinpoint" YOUR_API_KEY` + if [ -z "$your_api_key" ]; then + /usr/bin/defaults write "/Library/Preferences/com.jelockwood.pinpoint" YOUR_API_KEY -string "" + fi fi /bin/launchctl load "/Library/LaunchDaemons/com.jelockwood.pinpoint.plist" exit \ No newline at end of file