I need to be able to modify my openvpn auth file via a php script. I have made my http user a no-pass sudoer, as this machine is only available within my home network.
I currently have the following commands:
echo shell_exec("sudo echo '".$username."' > /etc/openvpn/auth.txt");
echo shell_exec("sudo echo '".$password."' >> /etc/openvpn/auth.txt");
but when run, they do not change the file at all, or provide any output in php.
How do I make this work?