$output=shell_exec('cat /etc/phpusers | sed -i "s/'.$old_value.'/'.$new_value.'/g" /etc/phpusers');//replace password for the user
$output=shell_exec('cat '.$GLOBALS['phpusersfile'].' | sed -i "s/'.$old_value.'/'.$new_value.'/g" '.$GLOBALS['phpusersfile']);//replace password for the user
echo'<p align=center ><font color="red"><br>Upgrade procedure will take place after reboot.<br>Please do not switch off the device during flashing procedure.</font></p>';
$output="# Configure Loopback\nauto lo\niface lo inet loopback\n\n#Force eth0 to be configured by DHCP\nauto eth0\niface eth0 inet dhcp\n\n# Uncomment this example for static configuration\n";
$output.="#iface eth0 inet static\n";
...
...
@@ -77,17 +77,17 @@
fwrite($file,$output);
fclose($file);
//We move the file to /wr/etc/
//We move the file to /usr/etc/network
copy($tmpfile,$interface_file);
echo'<center>DHCP is now set for eth0<br>Restarting network</center>';
//Let's up eth0
shell_exec('/etc/init.d/S40network restart');
echo'<center>DHCP is now set for eth0<br>Rebooting switch</center>';
$output="# Configure Loopback\nauto lo\niface lo inet loopback\n\n#Force eth0 to be configured by DHCP\n#auto eth0\n#iface eth0 inet dhcp\n\n# Uncomment this example for static configuration\n";
$output.="iface eth0 inet static\n";
...
...
@@ -133,13 +133,13 @@
fwrite($file,$output);
fclose($file);
//We move the file to /wr/etc/
//We move the file to /usr/etc/network
copy($tmpfile,$interface_file);
echo'<center>New static configuration saved for eth0<br>Changes will take place after reboot.</center>';