|  | @@ -80,6 +80,20 @@ function mark_unselected_apps_as_removed {
 | 
	
		
			
			| 80 | 80 |      done
 | 
	
		
			
			| 81 | 81 |  }
 | 
	
		
			
			| 82 | 82 |  
 | 
	
		
			
			|  | 83 | +function app_not_on_onion_only {
 | 
	
		
			
			|  | 84 | +    app_name="$1"
 | 
	
		
			
			|  | 85 | +
 | 
	
		
			
			|  | 86 | +    read_config_param ONION_ONLY
 | 
	
		
			
			|  | 87 | +
 | 
	
		
			
			|  | 88 | +    if [[ "$ONION_ONLY" != 'no' ]]; then
 | 
	
		
			
			|  | 89 | +        if ! grep -q "NOT_ON_ONION=1" "/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}"; then
 | 
	
		
			
			|  | 90 | +            echo "0"
 | 
	
		
			
			|  | 91 | +            return
 | 
	
		
			
			|  | 92 | +        fi
 | 
	
		
			
			|  | 93 | +    fi
 | 
	
		
			
			|  | 94 | +    echo "1"
 | 
	
		
			
			|  | 95 | +}
 | 
	
		
			
			|  | 96 | +
 | 
	
		
			
			| 83 | 97 |  function app_expected_to_be_installed {
 | 
	
		
			
			| 84 | 98 |      # is the given application expected to be installed by default?
 | 
	
		
			
			| 85 | 99 |      select_all_apps="$1"
 | 
	
	
		
			
			|  | @@ -108,16 +122,18 @@ function show_apps {
 | 
	
		
			
			| 108 | 122 |      # shellcheck disable=SC2068
 | 
	
		
			
			| 109 | 123 |      for a in ${APPS_AVAILABLE[@]}
 | 
	
		
			
			| 110 | 124 |      do
 | 
	
		
			
			| 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
 | 
	
		
			
			|  | 125 | +        if [[ $(app_not_on_onion_only "$a") != "0" ]]; then
 | 
	
		
			
			|  | 126 | +            if [[ ${APPS_INSTALLED[$app_index]} == "0" &&  "$select_all_apps" != "add-all" ]]; then
 | 
	
		
			
			| 115 | 127 |                  applist="$applist $n $a off"
 | 
	
		
			
			| 116 | 128 |              else
 | 
	
		
			
			| 117 |  | -                applist="$applist $n $a on"
 | 
	
		
			
			|  | 129 | +                if [[ $(app_expected_to_be_installed "$select_all_apps" "$a") == "0" ]]; then
 | 
	
		
			
			|  | 130 | +                    applist="$applist $n $a off"
 | 
	
		
			
			|  | 131 | +                else
 | 
	
		
			
			|  | 132 | +                    applist="$applist $n $a on"
 | 
	
		
			
			|  | 133 | +                fi
 | 
	
		
			
			| 118 | 134 |              fi
 | 
	
		
			
			|  | 135 | +            n=$((n+1))
 | 
	
		
			
			| 119 | 136 |          fi
 | 
	
		
			
			| 120 |  | -        n=$((n+1))
 | 
	
		
			
			| 121 | 137 |          app_index=$((app_index+1))
 | 
	
		
			
			| 122 | 138 |      done
 | 
	
		
			
			| 123 | 139 |  
 |