I’m struggling setting wifi for my new Raspberry Pi3 running Raspbian Stretch headless. I need to setup wlan0 to connect to a free hotspot that requires a specific login/passwd http POST sequence that can be done via wget.

The sample setup I’ve found was based on a NetworkManager/dispatcher.d shell script – but this does not seem recommended (supported?) on Raspbian/Stretch.

I’ve found another reference with pre-up, post-up & post-down statements in the interfaces file – which I understand should now stay almost empty…

Any advice on how to invoke a login script when the interface goes up? Or more generally, how to configure Wifi on public hotspot that require specific login sequence.

Thanks for any help/advice

  • Short answer: Write a systemd service file which runs your login script after the dhcpcd service has started. The script should verify that the wireless interface is active and check the SSID of the network. Once those two checks pass, the login sequence should begin... something like this: Running a script as a systemd service Commented Dec 29, 2017 at 23:41

1 Answer 1


I am using puppeteer for this purpose. It is based on nodesjs and provides a javascript interface to control Chromium. It also supports a headless operation.

If you install puppeteer it will automatically install chromium. Unfortunately it will install an x86 version which will not run on raspberry.

So you have to do some additional steps which can be retrieved from


Not the answer you're looking for? Browse other questions tagged or ask your own question.