#!/bin/bash

## Copyright (C) 2017 - 2020 ENCRYPTED SUPPORT LP <adrelanos@riseup.net>
## See the file COPYING for copying conditions.

#### meta start
#### project Whonix
#### category networking and firewall
#### description
## firewall starter wrapper
#### meta end

set -e

if [ -f "/run/qubes/this-is-templatevm" ]; then
   /usr/bin/whonix-workstation-firewall
elif [ -f "/usr/share/anon-gw-base-files/gateway" ]; then
   /usr/bin/whonix-gateway-firewall
elif [ -f "/usr/share/anon-ws-base-files/workstation" ]; then
   /usr/bin/whonix-workstation-firewall
elif [ -f "/usr/share/whonix-libvirt/marker" ]; then
   /usr/bin/whonix-host-firewall
else
   echo "ERROR: Neither file /usr/share/anon-gw-base-files/gateway nor file /usr/share/anon-ws-base-files/workstation exists! If this is a Whonix-Gateway, package anon-gw-base-files needs to be installed. If this is a Whonix-Workstation, package anon-ws-base-files needs to be installed." >&2
   exit 1
fi
