#!/bin/bash
#
# Copyright 2019-2020 VMware, Inc.  All rights reserved.
#
# This script manages the VMware URL redirection filter application
#

libpath="/usr/lib/vmware"
binpath="/usr/lib/vmware/view/bin"

# Add path to LD_LIBRARY_PATH
vm_append_to_library_path() {
   local ldBasePath
   if [ ! -z "$LD_LIBRARY_PATH" ]; then
      ldBasePath="$LD_LIBRARY_PATH"
   fi
   export LD_LIBRARY_PATH="$1:""$ldBasePath"
}

# load APIs to check client running environment
source $libpath/view/env/env_utils.sh

# Append client publish library path
if [ $(is_glibcxx_compatible) == "false" ]; then
   vm_append_to_library_path "$libpath"/gcc
fi

# Launch vmware url filter binary
"$binpath/vmware-urlFilter" "$@" &
