Add systemd hidden_wifi_connect.service
vim /etc/systemd/system/hidden_wifi_connect.service
[Unit]
Description=Connect to hidden wifi network on start
Before=network.target
[Service]
ExecStart=bash /home/paoloumali/connect_to_hidden_network.sh
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload sudo systemctl enable hidden_wifi_connect.service
Content of bash script: connect_to_hidden_network.sh
#!/bin/bash
nmcli radio wifi on
sleep 5s
nmcli con up id NameOfHiddenWifiSsid