Restart Wireless using "wifi"

Hi,

I'm new to this forum. I am using this "/sbin/wifi" to restart my wireless network on my wrtnode2P which is having Mediatek MT7628N processor. If I call this "/sbin/wifi" every 5 minutes when detected APCLI LINK DOWN, after a few hours and the wireless network is down. However when I call "/sbin/wifi" to restart wireless network again, I can still see APCLI LINK UP but cannot ping to my access point anymore. Below is the console message when the wireless network is down.

root@lede:~# /sbin/wifi
[325140.377261] br-lan: port 3(ra0) entered disabled state
[325140.459631] br-conf: port 1(ra1) entered disabled state
[325140.503280] br-lan: port 4(ra2) entered disabled state
[325140.764471] !!! APCLI LINK DOWN - IF(apcli0)!!!
[325141.294328] br-lan: port 2(apcli0) entered disabled state
[325141.971620] EEPROM:Read from [factory] offset 0x0,length 0x400.
[325144.333511] ch1 bssid=38:d1:35:02:09:64
[325144.337609] ch1 bssid=3a:d1:35:22:01:8e
[325144.341678] ch1 bssid=38:d1:35:02:01:3a
[325144.345795] ch1 bssid=3a:d1:35:12:01:3a
[325144.349865] ch1 bssid=3a:d1:35:22:01:3a
[325144.353953] ch1 bssid=38:d1:35:02:01:4c
[325144.358020] ch1 bssid=3a:d1:35:12:0a:3e
[325144.362144] ch1 bssid=3a:d1:35:12:01:4c
[325144.366231] ch1 bssid=3a:d1:35:22:01:4c
[325144.370301] ch1 bssid=3a:d1:35:12:09:ca
[325144.374383] ch1 bssid=3a:d1:35:12:0a:12
[325144.378452] ch1 bssid=3a:d1:35:12:0a:54
[325144.382521] ch1 bssid=38:d1:35:02:01:5a
[325144.386604] ch1 bssid=3a:d1:35:12:01:5a
[325144.390673] ch1 bssid=3a:d1:35:22:01:5a
[325144.394758] ch1 bssid=a0:f3:c1:60:7e:24
[325144.398825] ch1 bssid=38:d1:35:02:01:00
[325144.402895] ch1 bssid=3a:d1:35:12:01:00
[325144.406976] ch1 bssid=3a:d1:35:22:01:00
[325144.411045] ch1 bssid=38:d1:35:02:00:fc
[325144.415129] ch1 bssid=38:d1:35:02:00:01
[325144.419200] ch1 bssid=3a:d1:35:12:00:fc
[325144.423269] ch1 bssid=3a:d1:35:12:00:01
[325144.427351] ch1 bssid=3a:d1:35:12:0a:a0
[325144.431421] ch1 bssid=38:d1:35:02:09:bc
[325144.435496] ch1 bssid=3a:d1:35:12:01:62
[325144.439565] ch1 bssid=3a:d1:35:22:01:62
[325144.443659] ch1 bssid=3a:d1:35:22:0a:a0
[325144.447729] ch1 bssid=38:d1:35:02:00:de
[325144.451798] ch1 bssid=3a:d1:35:22:0a:9e
[325144.455879] ch1 bssid=38:d1:35:02:01:8e
[325144.459948] ch1 bssid=3a:d1:35:12:01:8e
[325144.464039] ch1 bssid=3a:d1:35:22:00:de
[325144.468112] ch1 bssid=3a:d1:35:12:09:64
[325144.472180] ch1 bssid=3a:d1:35:22:09:64
[325144.476285] ch1 bssid=3a:d1:35:22:00:fc
[325144.480356] ch1 bssid=38:d1:35:02:01:62
[325144.484440] ch1 bssid=38:d1:35:02:09:84
[325144.488507] ch1 bssid=3a:d1:35:22:01:22
[325144.492577] ch6 bssid=38:d1:35:02:0c:e0
[325144.496661] ch6 bssid=3a:d1:35:12:0c:e0
[325144.500758] ch10 bssid=10:c3:7b:e1:c7:e8
[325144.504933] ch10 bssid=38:d1:35:02:01:2a
[325144.509090] ch10 bssid=3a:d1:35:12:01:2a
[325144.513248] ch10 bssid=3a:d1:35:22:01:2a
[325144.517487] ch10 bssid=64:51:7e:80:3a:08
[325144.521650] ch10 bssid=3a:d1:35:12:0c:f0
[325144.525857] ch10 bssid=3a:d1:35:22:0c:f0
[325144.530018] ch10 bssid=38:d1:35:02:0c:f0
[325144.534200] ch11 bssid=1c:a5:32:a3:2e:40
[325144.538353] =====================================================
[325144.544651] Channel 1 : Dirty = 3480, False CCA = 0, Busy Time = 44015, Skip Channel = FALSE
[325144.553296] Channel 2 : Dirty = 1288, False CCA = 0, Busy Time = 47309, Skip Channel = FALSE
[325144.561954] Channel 3 : Dirty = 1140, False CCA = 0, Busy Time = 46776, Skip Channel = FALSE
[325144.570617] Channel 4 : Dirty = 992, False CCA = 0, Busy Time = 44300, Skip Channel = FALSE
[325144.579212] Channel 5 : Dirty = 844, False CCA = 0, Busy Time = 42348, Skip Channel = FALSE
[325144.587784] Channel 6 : Dirty = 330, False CCA = 0, Busy Time = 31797, Skip Channel = FALSE
[325144.596352] Channel 7 : Dirty = 276, False CCA = 0, Busy Time = 20139, Skip Channel = FALSE
[325144.604926] Channel 8 : Dirty = 304, False CCA = 0, Busy Time = 24123, Skip Channel = FALSE
[325144.613542] Channel 9 : Dirty = 332, False CCA = 0, Busy Time = 20093, Skip Channel = FALSE
[325144.622103] Channel 10 : Dirty = 772, False CCA = 0, Busy Time = 22049, Skip Channel = FALSE
[325144.630767] Channel 11 : Dirty = 336, False CCA = 0, Busy Time = 21157, Skip Channel = FALSE
[325144.639419] =====================================================
[325144.645706] Rule 1 CCA value : Min Dirtiness (Include extension channel) ==> Select Channel 7
[325144.654540] Min Dirty = 276
[325144.657461] ExChannel = 0 , 0
[325144.660554] BW = 20
[325144.693982] br-lan: port 3(ra0) entered forwarding state
[325144.699529] br-lan: port 3(ra0) entered forwarding state
[325146.353872] br-conf: port 1(ra1) entered forwarding state
[325146.359504] br-conf: port 1(ra1) entered forwarding state
[325146.693530] br-lan: port 3(ra0) entered forwarding state
sh: 7fff.3ad13512015e: unknown operand
[325148.044068] br-lan: port 4(ra2) entered forwarding state
[325148.049589] br-lan: port 4(ra2) entered forwarding state
[325148.119518] br-lan: port 2(apcli0) entered forwarding state
[325148.125357] br-lan: port 2(apcli0) entered forwarding state
[325148.353516] br-conf: port 1(ra1) entered forwarding state
[325150.043583] br-lan: port 4(ra2) entered forwarding state
[325150.123498] br-lan: port 2(apcli0) entered forwarding state
setting apcli
root@lede:~# [325153.953210] !!! APCLI LINK UP - IF(apcli0) AuthMode(7)=WPA2PSK, WepStatus(6)=AES!

Best Regards.