Modifying a openvpn config file



  • I'd like to run a script that updates the openvpn file in the /var/etc. Specifically, I'd like to dig the domain and update the contents of the "remote ip port" section of the openvpn .conf file.

    I am able to make the changes but notice that the changes aren't reflected in the gui. Are they cached somewhere?

    Thanks



  • the /var/etc file is generated dynamically.
    (almost) everything in pfSense in written in /conf/config.xml
    the individual config files for the various services are re-generated each time a change is made in the GUI

    so, instead of writing to /var/etc/whatever: use a script to make changes towards the config.xml. It's best to use the builtin function for this (check developer shell wiki: https://doc.pfsense.org/index.php/Using_the_PHP_pfSense_Shell)



  • @heper:

    the /var/etc file is generated dynamically.
    (almost) everything in pfSense in written in /conf/config.xml
    the individual config files for the various services are re-generated each time a change is made in the GUI

    so, instead of writing to /var/etc/whatever: use a script to make changes towards the config.xml. It's best to use the builtin function for this (check developer shell wiki: https://doc.pfsense.org/index.php/Using_the_PHP_pfSense_Shell)

    Oh thanks. Can I call /usr/local/sbin/pfSsh.php from the command and feed it commands. I tried the following which didn't work.

    /usr/local/sbin/pfSsh.php "print_r ( $config, true ) ; exec;"
    

    config: Undefined variable.

    The pfSsh.php file only accepts commands via redirection from another file?


Log in to reply