remote reboot / change IP address / CGI

Hi.

I made a configuration html page (+cgi) through wich i can change some settings on my digi (writing to some files).
Now i want to also remotely change the IP address and remotely reboot my digi!

i tried for IP address:


//deviceIpAddress is s string parameter that i get if from cgi input
sprintf(str,"PATH=$PATH:/sbin ifconfig eth0 %s etmask255.255.255.0 up
\r",deviceIpAddress);
system(str);

and for reboot:

system("reboot");

…but it’s not working! Probably because i don’t have rights to do this…

Can some one help me?
Klemen

the reboot should work.
however ifconfig will only change the IP temporary during runtime.
To change the IP permanently you need to change it in nvram, e.g. with “ubootenv” or by including libnvram to your CGI and calling NVRAM API functions.

You can find the source code on the Digi Embedded Linux DVD in:
toolchain/del_toolchain/packages/ubootenv
toolchain/del_toolchain/nvram/
toolchain/del_toolchain/libdigi/

I am using this VPN provider to change my IP address https://www.iwasel.com/en/ for a couple of months. There are many european servers.
They have good speed The best thing is that there is no traffic limit. I am online pretty much the whole time,"