#!/bin/bash

## Copyright (C) 2012 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

set -e

shopt -s nullglob
for i in /etc/uwt.d/*.conf /usr/local/etc/uwt.d/*.conf; do
   bash -n "$i"
   source "$i"
done

if [ $uwtwrapper_global = "1" ]; then
   enabled=true
fi

if [ "$UWT_DEV_PASSTHROUGH" = "1" ]; then
   enabled=false
fi

if [ "$enabled" = "true" ]; then
#### meta start
#### project Whonix
#### category networking
#### description

   echo "uwt INFO: Stream isolation for some applications enabled. uwt / torsocks will be automatically prepended to some commands. What is that? See:"
   echo "uwt INFO: https://www.whonix.org/wiki/Stream_Isolation/Easy"

#### meta end
else
   echo "uwt INFO: disabled."
fi
