Restart Captive Portal service from command Line Pfsense 2.4.4



  • How i can restart captive portal service from command line on pfsense 2.4.4-RELEASE-p3 (amd64) ?
    I need restart captive portal by cron job to reload configuration and load new letsencrypt certificate.
    thanks.


  • Rebel Alliance Developer Netgate

    /usr/local/sbin/pfSsh.php playback svc restart captiveportal yourzonename
    

  • Rebel Alliance Developer Netgate

    But if you are using the ACME package, you can do it in the Actions List for the certificate. You don't need to use the command line. Look at the example text in the Actions List when editing a certificate.



  • @jimp thanks.
    I'm importing certificates previously generated in another pfsense box. I made a php scrip to import it on xml so, I need restart captive portal on that's box.
    Thanks again and sorry my English.



  • If the certifiacte you import is only used for the captive portal, then @jimp first advise is the best.

    If the (wildcard ?) cert you're importing is also valid for the pfSense GUI, then "Select "Shell Command" and enter /etc/rc.restart_webgui" is best because it restarts all nginx instances, used by the GUI and all the captive portal(s).

    Btw : the captive portal functionality isn't some program or a process by itself.
    It's a mixture of
    A web server, nginx in this case, that hosts the login, error and logout page. This one can use certs so needs to be restarted in case of cert change,
    A OS based firewall with a set of rules,
    A background cron task that throws out inactive and/or max delayed and/or expired voucher's connections.



  • Thanks again.. the solution posted by @jimp worked for me!


Log in to reply