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