File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 29
29
from vyos .configverify import verify_mtu_ipv6
30
30
from vyos .ifconfig import WWANIf
31
31
from vyos .utils .dict import dict_search
32
+ from vyos .utils .network import is_wwan_connected
32
33
from vyos .utils .process import cmd
33
34
from vyos .utils .process import call
34
35
from vyos .utils .process import DEVNULL
@@ -137,7 +138,7 @@ def apply(wwan):
137
138
break
138
139
sleep (0.250 )
139
140
140
- if 'shutdown_required' in wwan :
141
+ if 'shutdown_required' in wwan or ( not is_wwan_connected ( wwan [ 'ifname' ])) :
141
142
# we only need the modem number. wwan0 -> 0, wwan1 -> 1
142
143
modem = wwan ['ifname' ].lstrip ('wwan' )
143
144
base_cmd = f'mmcli --modem { modem } '
@@ -159,7 +160,7 @@ def apply(wwan):
159
160
160
161
return None
161
162
162
- if 'shutdown_required' in wwan :
163
+ if 'shutdown_required' in wwan or ( not is_wwan_connected ( wwan [ 'ifname' ])) :
163
164
ip_type = 'ipv4'
164
165
slaac = dict_search ('ipv6.address.autoconf' , wwan ) != None
165
166
if 'address' in wwan :
You can’t perform that action at this time.
0 commit comments