summaryrefslogtreecommitdiff
path: root/src/mts-fpga-loader.sh
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2018-04-03 17:40:26 -0500
committerJohn Klug <john.klug@multitech.com>2018-04-03 17:40:26 -0500
commit6ab08915ecf2ad8ddf6b4c8e6bfe54070fb31257 (patch)
treee6a518261b83d8058b3dacd94c3ec665ce8fd43e /src/mts-fpga-loader.sh
parente3615d09e64b1584b9e7820e2a8bcdb5569d2994 (diff)
downloadmts-id-eeprom-6ab08915ecf2ad8ddf6b4c8e6bfe54070fb31257.tar.gz
mts-id-eeprom-6ab08915ecf2ad8ddf6b4c8e6bfe54070fb31257.tar.bz2
mts-id-eeprom-6ab08915ecf2ad8ddf6b4c8e6bfe54070fb31257.zip
Wrapper for mts-fpga-loader
Diffstat (limited to 'src/mts-fpga-loader.sh')
-rw-r--r--src/mts-fpga-loader.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mts-fpga-loader.sh b/src/mts-fpga-loader.sh
new file mode 100644
index 0000000..027ff09
--- /dev/null
+++ b/src/mts-fpga-loader.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+lora_1_5_h_hw="-LORA-1.5\$"
+lora_2_1_hw="-LORA-2.1\$"
+L15=/sbin/mts-fpga-loader-1_5
+L21=/sbin/sem-fpga-loader
+
+lora_hw=$(mts-io-sysfs show lora/hw-version 2> /dev/null)
+
+if [[ $lora_hw =~ ${lora_1_5_h_hw} ]]; then
+ if [[ -x ${L15} ]] ; then
+ ${L15} "$@"
+ else
+ echo "Is mts-id-eeprom installed properly?"
+ echo "Missing executable ${L15}"
+ fi
+elif [[ $lora_hw =~ ${lora_2_1_hw} ]]; then
+ if [[ -x ${L21} ]] ; then
+ ${L21} "$@"
+ else
+ echo "Is sem-fpga-loader installed properly?"
+ echo "Missing executable ${L21}"
+ fi
+else
+ echo "Supported FPGA hardware not found. Exiting."
+ exit 1
+fi