ndejong / pfsense_fauxapi

REST based API interface for pfSense 2.3.x and 2.4.x to facilitate devops
Apache License 2.0
354 stars 61 forks source link

Wake On LAN via fauxapi #67

Open bdf0506 opened 4 years ago

bdf0506 commented 4 years ago

I am struggling to get the function_call for WakeOnLan to work with FauxAPI.

I'm able to use the exec_command and wake that way, but that gives the API user too much access that I do not want. This works and sends a WOL packet fine:

fauxapi --host pfsense --apikey **** --apisecret ***** function_call "{\"function\": \"exec_command\", \"args\": \"wake igb1.20 78:5d:c8:ee:ff:aa\"}"

This below function_call using the WakeOnLan function does not work, though everything appears that it should work. fauxapi --host pfsense --apikey **** --apisecret ***** function_call "{\"function\": \"WakeOnLan\", \"args\": [\"192.168.20.255\", \"78:5d:c8:ee:ff:aa\"]}"

The FauxAPI logs even show that it processed the command and sends a magic packet, but I don't see it actually sending a magic packet.

Jul 26 10:02:51 pfSense php-fpm[61319]: {"INFO":"20200726Z100251 :: fauxapi\\v1\\fauxApi::__call","DATA":{"user_action":"function_call","callid":"5f1d8d0bc9ba9","client_ip":"192.168.30.203"},"source":"fauxapi"}
Jul 26 10:02:51 pfSense php-fpm[61319]: /fauxapi/v1/index.php: Magic Packet sent () to (192.168.20.255) MAC=78:5d:c8:ee:ff:aa

Any ideas?