Bob Mottram 6 years ago
parent
commit
fcb209d3a9
1 changed files with 24 additions and 29 deletions
  1. 24
    29
      src/freedombone-addremove

+ 24
- 29
src/freedombone-addremove View File

108
     # shellcheck disable=SC2068
108
     # shellcheck disable=SC2068
109
     for a in ${APPS_AVAILABLE[@]}
109
     for a in ${APPS_AVAILABLE[@]}
110
     do
110
     do
111
-        if [[ $(app_not_on_onion_only "$a") != "0" ]]; then
112
-            if [[ ${APPS_INSTALLED[$app_index]} == "0" &&  "$select_all_apps" != "add-all" ]]; then
111
+        if [[ ${APPS_INSTALLED[$app_index]} == "0" &&  "$select_all_apps" != "add-all" ]]; then
112
+            applist="$applist $n $a off"
113
+        else
114
+            if [[ $(app_expected_to_be_installed "$select_all_apps" "$a") == "0" ]]; then
113
                 applist="$applist $n $a off"
115
                 applist="$applist $n $a off"
114
             else
116
             else
115
-                if [[ $(app_expected_to_be_installed "$select_all_apps" "$a") == "0" ]]; then
116
-                    applist="$applist $n $a off"
117
-                else
118
-                    applist="$applist $n $a on"
119
-                fi
117
+                applist="$applist $n $a on"
120
             fi
118
             fi
121
-            n=$((n+1))
122
-            app_index=$((app_index+1))
123
         fi
119
         fi
120
+        n=$((n+1))
121
+        app_index=$((app_index+1))
124
     done
122
     done
125
 
123
 
126
     # shellcheck disable=SC2086
124
     # shellcheck disable=SC2086
149
     # shellcheck disable=SC2068
147
     # shellcheck disable=SC2068
150
     for a in ${APPS_INSTALLED[@]}
148
     for a in ${APPS_INSTALLED[@]}
151
     do
149
     do
152
-        if [[ $(app_not_on_onion_only "$a") != "0" ]]; then
153
-            if [[ ${APPS_INSTALLED[$app_index]} == "1" ]]; then
154
-                if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then
155
-                    if [ ${n} -gt 0 ]; then
156
-                        removals="$removals ${APPS_AVAILABLE[$app_index]}"
157
-                    else
158
-                        removals="${APPS_AVAILABLE[$app_index]}"
159
-                    fi
160
-                    n=$((n+1))
150
+        if [[ ${APPS_INSTALLED[$app_index]} == "1" ]]; then
151
+            if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then
152
+                if [ ${n} -gt 0 ]; then
153
+                    removals="$removals ${APPS_AVAILABLE[$app_index]}"
154
+                else
155
+                    removals="${APPS_AVAILABLE[$app_index]}"
161
                 fi
156
                 fi
157
+                n=$((n+1))
162
             fi
158
             fi
163
-            app_index=$((app_index+1))
164
         fi
159
         fi
160
+        app_index=$((app_index+1))
165
     done
161
     done
166
 
162
 
167
     # if no apps to be removed then don't do anything
163
     # if no apps to be removed then don't do anything
196
     # shellcheck disable=SC2068
192
     # shellcheck disable=SC2068
197
     for a in ${APPS_INSTALLED[@]}
193
     for a in ${APPS_INSTALLED[@]}
198
     do
194
     do
199
-        if [[ $(app_not_on_onion_only "$a") != "0" ]]; then
200
-            if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
201
-                if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
202
-                    if [ ${n} -gt 0 ]; then
203
-                        installs="$installs ${APPS_AVAILABLE[$app_index]}"
204
-                    else
205
-                        installs="${APPS_AVAILABLE[$app_index]}"
206
-                    fi
207
-                    n=$((n+1))
195
+        if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
196
+            if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
197
+                if [ ${n} -gt 0 ]; then
198
+                    installs="$installs ${APPS_AVAILABLE[$app_index]}"
199
+                else
200
+                    installs="${APPS_AVAILABLE[$app_index]}"
208
                 fi
201
                 fi
202
+                n=$((n+1))
209
             fi
203
             fi
210
-            app_index=$((app_index+1))
211
         fi
204
         fi
205
+        app_index=$((app_index+1))
206
+
212
     done
207
     done
213
 
208
 
214
     # if no apps to be installed then don't do anything
209
     # if no apps to be installed then don't do anything