#!/bin/bash

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

#### meta start
#### project Whonix
#### category networking
#### description

## This script is used by uwtwrapper as a workaround to preserve the zeroth
## argument when executing programs with other wrappers, such as faketime or torsocks.
#### meta end

if [ ! "$uwtwrapper_verbose" = "" ]; then
   if [ "$uwtwrapper_verbose" -ge 1 ]; then
      set -x
   fi
fi

true "$0: START"
true "$0: uwtwrapper_zeroarg: $uwtwrapper_zeroarg"
true "$0: uwtwrapper_parent: $uwtwrapper_parent"

## Execute $uwtwrapper_parent.anondist-orig with the zeroth argument set to
## $uwtwrapper_zeroarg and the other arguments set to $@.
exec -a "$uwtwrapper_zeroarg" "$uwtwrapper_parent.anondist-orig" "$@"
