
#!/bin/bash

if [[ $HOSTTYPE == "x86_64" ]]; then
 export LINBPQ=linbpq64;
elif [[ $HOSTTYPE == "aarch64" ]]; then
 export LINBPQ=pilinbpq64;
elif [[ $HOSTTYPE == "arm" ]];then
 export LINBPQ=pilinbpq;
else
 export LINBPQ=linbpq;
fi

echo "Downloading $LINBPQ  to linbpq"

mkdir linbpq
cd linbpq
wget -nv http://www.cantab.net/users/john.wiseman/Downloads/Beta/$LINBPQ -O linbpq
chmod +x linbpq

echo "Downloading config files"

wget -nv http://www.cantab.net/users/john.wiseman/Downloads/SimpleRMSGateway_bpq32.cfg -O bpq32.cfg

echo "Downloading HTML Files"

mkdir HTML

echo "Updating your callsign in configuration files"

read -e -p "Enter Your Callsign (Without SSID): "  CALL
CALL=$(echo "$CALL" | tr '[:lower:]' '[:upper:]')

sed -i "s/MYCALL/$CALL/g" bpq32.cfg

