# run this script with sudo # https://www.raspberryconnect.com/projects/65-raspberrypi-hotspot-accesspoints/158-raspberry-pi-auto-wifi-hotspot-switch-direct-connection apt-get -Y install hostapd apt-get -Y install dnsmasq systemctl unmask hostapd systemctl disable hostapd systemctl disable dnsmasq mv hotspot.conf /etc/hostapd/hostapd.conf chmod +x autohotspot mv autohotspot /usr/bin/autohotspot (crontab -l 2>/dev/null; echo "*/5 * * * * sudo /usr/bin/autohotspot >/dev/null 2>&1") | crontab -e