Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Perl libraries to manipulate config.xml file?

    Scheduled Pinned Locked Moved pfSense Packages
    7 Posts 3 Posters 3.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      manoharks
      last edited by

      Hello everyone, I'm new to pfsense. I need to write a perl script to perform Create/Read/Update/Delete operations on the firewall rules in the config.xml file. I have found a file called config.inc in the /etc/inc/ directory that claims to have functions for the above operations, but it is in PHP. Are there any other libraries or other ways to accomplish this task?

      Thanks.  :)

      1 Reply Last reply Reply Quote 0
      • D
        dvserg
        last edited by

        No, only php libs.

        SquidGuardDoc EN  RU Tutorial
        Localization ru_PFSense

        1 Reply Last reply Reply Quote 0
        • jimpJ
          jimp Rebel Alliance Developer Netgate
          last edited by

          If you are dead-set on perl you could port that library to perl if you really wanted to, but that seems like a lot of work for very little benefit and potentially a way to introduce errors and corrupt the configuration.

          Perl doesn't ship with pfSense, though several packages install it. I believe that only PHP and Lua are shipped with pfSense, and only PHP is used when working with most aspects of the system.

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • D
            dvserg
            last edited by

            @jimp:

            I believe that only PHP and Lua are shipped with pfSense, and only PHP is used when working with most aspects of the system.

            Can i see Lua in pfSense (examples exists)?

            SquidGuardDoc EN  RU Tutorial
            Localization ru_PFSense

            1 Reply Last reply Reply Quote 0
            • jimpJ
              jimp Rebel Alliance Developer Netgate
              last edited by

              I think it's only used during the install process. The install scripts are done with Lua.

              After install, the binary is lua50. I thought there was a symlink for lua -> lua50 but I don't see it now.

              Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

              Need help fast? Netgate Global Support!

              Do not Chat/PM for help!

              1 Reply Last reply Reply Quote 0
              • D
                dvserg
                last edited by

                Thanks!

                SquidGuardDoc EN  RU Tutorial
                Localization ru_PFSense

                1 Reply Last reply Reply Quote 0
                • M
                  manoharks
                  last edited by

                  Thank You very much everyone. I guess I'll write the perl modules myself.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.