diff --git a/.DS_Store b/.DS_Store index 2d16fd2..e2b6805 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/CommonResources b/CommonResources index 43ec411..1c28167 100755 --- a/CommonResources +++ b/CommonResources @@ -449,7 +449,7 @@ endScript () mv "$oldPackageListFile" "$packageListFile" fi - if [ ! -f "$packageListFile" ] || [ $(grep -c "$packageName\s" "$packageListFile") == 0 ]; then + if [ ! -f "$packageListFile" ] || [ $(grep -c "^$packageName\s" "$packageListFile") == 0 ]; then logMessage "adding $packageName to SetupHelper package list" echo "$packageName $packageGitHubUser $packageGitHubBranch" >> "$packageListFile" fi diff --git a/DbusSettingsResources b/DbusSettingsResources index a989086..ed2a9d0 100755 --- a/DbusSettingsResources +++ b/DbusSettingsResources @@ -34,11 +34,9 @@ source "/data/SetupHelper/LogHandler" updateDbusStringSetting () { - local oldValue - - oldValue=$(dbus-send --system --print-reply=literal --dest=com.victronenergy.settings "$1"\ - com.victronenergy.BusItem.GetValue 2> /dev/null | awk '{print $2}') - if [ -z $oldValue ]; then + dbus-send --system --print-reply=literal --dest=com.victronenergy.settings "$1"\ + com.victronenergy.BusItem.GetValue 2> /dev/null | awk '{print $2}' + if (( $? != 0 )); then logMessage "creating dbus Setting $1" dbus -y com.victronenergy.settings / AddSettings "%[ {\"path\":\"$1\", \"default\":\"\"} ]" &> /dev/null fi diff --git a/blindInstall b/blindInstall index bcc6ab5..91994f0 100755 --- a/blindInstall +++ b/blindInstall @@ -27,6 +27,8 @@ while [ $(dbus -y | grep -c "com.victronenergy.settings") == 0 ]; do sleep 1 done +sleep 2 + logMessage "starting up" # a package setup script normally prompts for user input diff --git a/setup b/setup index bea5012..710a11c 100755 --- a/setup +++ b/setup @@ -151,17 +151,30 @@ if [ $scriptAction == 'INSTALL' ] ; then cp "$scriptDir/defaultPackageList" "$packageListFile" fi + # check both parameters to insure they are both created dbus-send --system --print-reply=literal --dest=com.victronenergy.settings /Settings/PackageVersion/CheckingPackage\ - com.victronenergy.BusItem.GetValue &> /dev/null + com.victronenergy.BusItem.GetValue &> /dev/null if (( $? != 0 )); then + settingsInstalled=false + # first setting exists, check the second + else + dbus-send --system --print-reply=literal --dest=com.victronenergy.settings /Settings/PackageVersion/GitHubAutoUpdate\ + com.victronenergy.BusItem.GetValue &> /dev/null + if (( $? != 0 )); then + settingsInstalled=false + else + settingsInstalled=true + fi + fi + if ! $settingsInstalled ; then logMessage "creating SetupHelper Settings" dbus -y com.victronenergy.settings /Settings AddSettings\ '%[ {"path": "/PackageVersion/GitHubAutoUpdate", "default":0},\ {"path": "/PackageVersion/CheckingPackage", "default":""},]' > /dev/null # relocate options and current values - moveSetting "$setupOptionsDir/autoGitHubUpdate" "/Settings/GuiMods/GitHubAutoUpdate" "/PackageVersion/GitHubAutoUpdate" + moveSetting "$setupOptionsDir/autoGitHubUpdate" "/Settings/GuiMods/GitHubAutoUpdate" "/Settings/PackageVersion/GitHubAutoUpdate" rm -f "$setupOptionsDir/autoGitHubUpdate" - moveSetting "" "/Settings/GuiMods/CheckingPackage" "/PackageVersion/CheckingPackage" + moveSetting "" "/Settings/GuiMods/CheckingPackage" "/Settings/PackageVersion/CheckingPackage" fi diff --git a/venus-data.tgz b/venus-data.tgz index 1064d47..640e14c 100644 Binary files a/venus-data.tgz and b/venus-data.tgz differ diff --git a/version b/version index 1d17edb..7784d97 100644 --- a/version +++ b/version @@ -1 +1 @@ -v3.10 +v3.11