How to execute shell commands from within functions.php?
-
Hi,
I have a a small wp site with a form. Once user clicks submit button the site processes a a few functions (all working) located within functions.php (ok, know this may not be best practice but did it for simplicity and didn’t want to write my own plug-in).Functions include:
1) creation of unique username
2) creation of a random password
3) storing unique username into dbI need to submit the random password to MQTT server using mosquitto_passed tool like this:
/usr/bin/mosquitto_passwd -b /etc/mosquitto/passwd [uniqueusername] [randompassword]Both the WP server and the MQTT server reside within same machine (Raspbian).
How do I execute such cmd line from within functions.php?? Or any other shell command?
The topic ‘How to execute shell commands from within functions.php?’ is closed to new replies.