#!/bin/sh
# Installed as /opt/copvpn/copvpn -- the entry point the .desktop file runs.
#
# CopVPN ships its own Qt 6.8.3 (the same build macOS and Windows use) because
# Ubuntu 24.04 only carries Qt 6.4.2. This points the loader at the bundled copy
# instead of the system one.
set -eu

DIR=/opt/copvpn

export LD_LIBRARY_PATH="$DIR/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export QT_PLUGIN_PATH="$DIR/plugins"
export QML2_IMPORT_PATH="$DIR/qml"
export QML_IMPORT_PATH="$DIR/qml"

exec "$DIR/CopVPN" "$@"
