#!/bin/sh
#===============================================================================
#
#  btfilter
#
#  Copyright (C) 2015 by Digi International Inc.
#  All rights reserved.
#
#  This program is free software; you can redistribute it and/or modify it
#  under the terms of the GNU General Public License version 2 as published by
#  the Free Software Foundation.
#
#
#  !Description: Configure Bluetooth
#
#===============================================================================

set -e

if [ "${1}" != "start" ]; then
	exit 0
fi

SCRIPTNAME="$(basename "${0}")"

# Check if this hardware does support Bluetooth
if [ -d "/proc/device-tree/bluetooth" ]; then
	echo "Starting btfilter service."
	if ! abtfilt -b -x -s -w wlan0 1>/dev/null; then
		echo "${SCRIPTNAME}: FAILED (abtfilt)"
		exit
	fi
fi
