Thanks Gertjan this worked very well
Thanks,Can you please let me know which config file I need to use? Also does Write_Config can be called using a Cron? I mean without doing login or Authentication.
@SmartCodar:Basically I need to Upload the Captive Portal Page pro-grammatically.
…..
For example when PFSense System is rebooted. is there any way where I need to copy my Captive Portal Page Content file? I have tried to copy in \var\etc but it wont worked. Is there any additional step I need to doFrom how I understand it, when pfSense reboots, using PHP a script, use wget/ftp/curl/what-ever to 'import' a new html file, and write_config() it.
See here https://github.com/pfsense/pfsense/blob/master/src/usr/local/www/services_captiveportal.php#L447The other way around: create a script (it can be on any device that can access pfSense**) that accepts a $POST, so you can send ove new file - put it in the config, write_config() and restart the captive portal service.
** if needed, you can decide to skip the entire GUI login protection. Remember, its PHP, your free to do what you want ;)
Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.