#!/bin/sh
# The fnOS app link follows the storage pool selected by the installer.
APPLICATION=/var/apps/nastunnel/target/scripts/application
[ -x "$APPLICATION" ] || exit 3
case "${1:-}" in
    start|stop)
        /var/apps/nastunnel/target/ui/index.cgi --fnos-folder-access "$1" || echo 'fnOS folder access is unavailable' >&2
        ;;
esac
unset TRIM_API_TOKEN
exec /bin/sh "$APPLICATION" "$@"
