#!/bin/sh
# AppImage entry point: run the bundled binary with the AppDir's libs. The
# assets sit in usr/share/rfguard/assets, which the binary finds relative to
# itself (<exe dir>/../share/rfguard/assets).
#
# BLE needs CAP_NET_RAW. File capabilities cannot be carried inside an
# AppImage, so the BLE scan reports "permission denied" unless the AppImage is
# run as root or extracted and the binary given the capabilities (docs/LINUX.md).
HERE="$(dirname "$(readlink -f "$0")")"
export LD_LIBRARY_PATH="$HERE/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"

exec "$HERE/usr/bin/rfguard" "$@"
