#!/bin/sh
# Launches the Nsoniki AppImage the kit installed. AppImages mount themselves
# with FUSE; where FUSE 2 isn't available (newer Ubuntu leaves it out) the
# AppImage can instead unpack itself and run -- slower to start, same app.
APP="@APPIMAGE@"
if [ ! -x "$APP" ]; then
  echo "nsoniki: $APP is missing -- reinstall the Nsoniki kit" >&2
  exit 1
fi
if ! command -v fusermount >/dev/null 2>&1 && ! [ -e /usr/lib/libfuse.so.2 ] && ! ldconfig -p 2>/dev/null | grep -q 'libfuse\.so\.2'; then
  export APPIMAGE_EXTRACT_AND_RUN=1
fi
exec "$APP" "$@"
