Avoid bad app sequence

This commit is contained in:
Bob Mottram 2018-05-09 15:33:48 +01:00
parent c98b2f2e00
commit a1a7e92d90
1 changed files with 18 additions and 14 deletions

View File

@ -163,14 +163,16 @@ function remove_apps_selected {
# shellcheck disable=SC2068 # shellcheck disable=SC2068
for a in ${APPS_INSTALLED[@]} for a in ${APPS_INSTALLED[@]}
do do
if [[ ${APPS_INSTALLED[$app_index]} == "1" ]]; then if [[ $(app_not_on_onion_only "$a") != "0" ]]; then
if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then if [[ ${APPS_INSTALLED[$app_index]} == "1" ]]; then
if [ ${n} -gt 0 ]; then if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then
removals="$removals ${APPS_AVAILABLE[$app_index]}" if [ ${n} -gt 0 ]; then
else removals="$removals ${APPS_AVAILABLE[$app_index]}"
removals="${APPS_AVAILABLE[$app_index]}" else
removals="${APPS_AVAILABLE[$app_index]}"
fi
n=$((n+1))
fi fi
n=$((n+1))
fi fi
fi fi
app_index=$((app_index+1)) app_index=$((app_index+1))
@ -208,14 +210,16 @@ function install_apps_selected {
# shellcheck disable=SC2068 # shellcheck disable=SC2068
for a in ${APPS_INSTALLED[@]} for a in ${APPS_INSTALLED[@]}
do do
if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then if [[ $(app_not_on_onion_only "$a") != "0" ]]; then
if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
if [ ${n} -gt 0 ]; then if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
installs="$installs ${APPS_AVAILABLE[$app_index]}" if [ ${n} -gt 0 ]; then
else installs="$installs ${APPS_AVAILABLE[$app_index]}"
installs="${APPS_AVAILABLE[$app_index]}" else
installs="${APPS_AVAILABLE[$app_index]}"
fi
n=$((n+1))
fi fi
n=$((n+1))
fi fi
fi fi
app_index=$((app_index+1)) app_index=$((app_index+1))