Heading to an URL after a reboot

Viewed 44

I built a user-interface to change the IP Adress from my raspberry pi. Now I want the browser heading to my new IP Adress, after a reboot automatically... Something like this:

if( isset( $_POST['reboot'] ) ) {
  exec("/sbin/shutdown -r now");
  header("Location: $new_ip");
}

It's clear to me, that this can't work, because if I execute the reboot nothing else will processed.

I saw this function in many user-interfaces like from Synology.

1 Answers

Maybe you can edit your hosts file and set a reference from you new IP to some address. For example 10.0.0.138 my.random.ip.com (Where 10.0.0.138 is your new IP). Now in your browser you can set that IP for new opened tab (In chrome go to advance settings and look for 'on startup').

Related