File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -372,6 +372,7 @@ type Config struct {
372
372
WifiPowerSave * bool `json:"wifi_power_save"`
373
373
374
374
// When true, advertise via mdns on pre-existing network instead of using static IP and captive portal.
375
+ // (Instead of the default behavior of starting a captive portal).
375
376
MDNSMode bool `json:"mdns_mode"`
376
377
}
377
378
Original file line number Diff line number Diff line change @@ -65,6 +65,9 @@ func (w *Provisioning) getLastNetworkTried() NetworkInfo {
65
65
}
66
66
67
67
func (w * Provisioning ) checkOnline (force bool ) error {
68
+ if w .cfg .MDNSMode {
69
+ return nil
70
+ }
68
71
if force {
69
72
if err := w .nm .CheckConnectivity (); err != nil {
70
73
w .logger .Error (err )
Original file line number Diff line number Diff line change @@ -145,6 +145,10 @@ func (w *Provisioning) init(ctx context.Context) error {
145
145
w .mainLoopHealth .MarkGood ()
146
146
w .bgLoopHealth .MarkGood ()
147
147
148
+ if w .cfg .MDNSMode {
149
+ w .logger .Info ("skipping networkmanager init because mdnsmode" )
150
+ return nil
151
+ }
148
152
nm , err := w .getNM ()
149
153
if err != nil {
150
154
return err
@@ -386,6 +390,9 @@ func (w *Provisioning) updateHotspotSSID(cfg *Config) {
386
390
387
391
// must be run inside dataMu lock.
388
392
func (w * Provisioning ) writeWifiPowerSave (ctx context.Context ) error {
393
+ if w .cfg .MDNSMode {
394
+ return nil
395
+ }
389
396
contents := wifiPowerSaveContentsDefault
390
397
if w .cfg .WifiPowerSave != nil {
391
398
if * w .cfg .WifiPowerSave {
You can’t perform that action at this time.
0 commit comments