#!/bin/bash
#
# Fierro Soft - Lambda Sistemas
# Fierro Client wrapper launcher
# created on Jun 17, 2005.
#
if [ -f /etc/opt/fierro/clientserver.conf ]; then
    . /etc/opt/fierro/clientserver.conf
fi

if [ -n "$SERVER" ]; then
	APPEND="--server $SERVER --webserver $WEBSERVER"
fi

if [ -n "$SUCURSAL" ]; then
    APPEND="$APPEND --sucursal $SUCURSAL"
fi

if [ -f ~/.fierrorc ]; then
    source ~/.fierrorc
fi

if [ -z $PYTHON ]; then
	PYTHON=python
fi

export FIERRO_LOGFILE=/var/log/fierroclient.log

# Work around GTK/GdkPixbuf loader issues on Ubuntu 24.xx
if [ -f /etc/os-release ]; then
    . /etc/os-release
    if [ "${ID:-}" = "ubuntu" ] && echo "${VERSION_ID:-}" | grep -q '^24'; then
        export GTK_A11Y=none
        export GTK_MODULES=
    fi
fi

/opt/fierroclient-1.60.2/fierro $APPEND "$@"
