#!/bin/sh
mac=$(./mac_address.sh)
echo $mac
#apiurl=$(cat /usr/share/adxba/unity/unity_service/data/config.json | \
apiurl="https://bt-api.unityplatform.com"
#sed -e 's/[{}]/''/g' | tr -d '"' | \
#awk -v RS=',"' -F: '/^mac/ {print $2}')
echo $apiurl
port=$(curl -s "$apiurl/standalone/sharp/api/portnumbers.php?requestType=get&mac=$mac" | \
  sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^ssh/ {print $2}' | tr -d '"')
echo $port
./ssh_tunnel_start.sh $port
