I can do this pretty quickly. It's not hard. The real problem is giving the web server enough permission to be able to perform this task (as root). Usually in cases like this, I use sudo to execute a specific program that handles the parts that need to be run as root. So, if you want this done as a PHP script, it will require this extra step too.