#!/bin/sh

# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2014 Stephan Raue (stephan@openelec.tv)

# check the Security chip if we run on a WeTek device
  lsusb -d 096e:0006 &> /dev/null
  LSUSB_RET=$?

if [ -f /storage/.config/remote.conf ]; then
  /usr/bin/remotecfg /storage/.config/remote.conf
elif [ -f /etc/amremote/remote.conf ]; then
  /usr/bin/remotecfg /etc/amremote/remote.conf
elif [ "$LSUSB_RET" = 0 ]; then
  /usr/bin/remotecfg /etc/amremote/wetek.conf
elif [ "$LSUSB_RET" = 1 ]; then
  /usr/bin/remotecfg /etc/amremote/libreelec.conf
fi
