WiFi Problem when using external WiFi Antenna!

Hi,
I am using 18.06 on GL.inet ar150

WiFi Disappears Randomly , and when I login and check it says radio1 is up !!
#(ubus call network.wireless status | jsonfilter -e '@.radio1.up'
#true

if I execute
wifi up

it works normally and after sometime stop.

I really want to check if radio1 is up and if it is down to automatically turn on

I created following sh script but based on above command it always return true so it couldn't work for me . is there anyway to check if radio1 is really up ?


version=$(ubus call network.wireless status | jsonfilter -e '@.radio1.up')
if [[ $version == "true" ]]; then
   echo "T"
   ip link set dev wlan4 up trailers on qlen 0 dynamic on arp off
else
   wifi down && wifi up
   #echo "False"
fi