change ip address of server using PHP

前端 未结 2 673
半阙折子戏
半阙折子戏 2021-01-15 17:12

i need to be able to change the IP address of a server using PHP. i\'m trying to use ifconfig eth0 down as the www-data user to make sure it will

2条回答
  •  梦毁少年i
    2021-01-15 17:46

    I had a similar problem and am considering the following solution:

    1) The php page reads in the IP, Netmask, and gateway, checking for proper formatting and whether the IP is viable and writes that to a text file

    2) A cronjob written in whatever, looks for that file, and if it is there, it reads in the contents, parses it, and makes the changes

    This should be sufficiently secure.

提交回复
热议问题