I have a Shell script which is named "dns.sh" which changes the nameserver in /etc/resolv.conf. it looks like: #!/bin/bash echo nameserver 127.0.0.1 | sudo tee /etc/resolv.conf Problem is, if i make a autostart instantly after login through lightdm, then captive portals wont work... Pretty annoying. How can i let this script autostart like after 20-30seconds ?