|  | @@ -9174,7 +9174,10 @@ function install_search_engine {
 | 
	
		
			
			| 9174 | 9174 |          if [ -f ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml ]; then
 | 
	
		
			
			| 9175 | 9175 |              SEARCH_ENGINE_SECRET_KEY=$(cat $COMPLETION_FILE | grep "Search engine key" | awk -F ':' '{print $2}')
 | 
	
		
			
			| 9176 | 9176 |              sed -i "s|secret_key.*|secret_key : \"${SEARCH_ENGINE_SECRET_KEY}\"|g" ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
 | 
	
		
			
			| 9177 |  | -            sed -i "s|base_url.*|base_url : \"http://${SEARCH_ENGINE_ONION_HOSTNAME}\"|g" ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
 | 
	
		
			
			|  | 9177 | +            if [ -f /var/lib/tor/hidden_service_searx/hostname ]; then
 | 
	
		
			
			|  | 9178 | +                SEARCH_ENGINE_ONION_HOSTNAME=$(echo /var/lib/tor/hidden_service_searx/hostname)
 | 
	
		
			
			|  | 9179 | +                sed -i "s|base_url.*|base_url : \"http://${SEARCH_ENGINE_ONION_HOSTNAME}\"|g" ${SEARCH_ENGINE_PATH}/searx/searx/settings.yml
 | 
	
		
			
			|  | 9180 | +            fi
 | 
	
		
			
			| 9178 | 9181 |          fi
 | 
	
		
			
			| 9179 | 9182 |      fi
 | 
	
		
			
			| 9180 | 9183 |  
 |