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

    Database of pfsense

    Scheduled Pinned Locked Moved Off-Topic & Non-Support Discussion
    7 Posts 3 Posters 4.6k 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.
    • R
      richasharma
      last edited by

      hello everyone

      I am working on the pf sense. But I am not able to find the data base directory of all the database files????

      please inform me if anyone knows where all the database files are located in pfsense

      1 Reply Last reply Reply Quote 0
      • P
        phil.davis
        last edited by

        All the settings are saved in /cf/conf/config.xml

        The system reads from that and sets up the interfaces in FreeBSD and makes the rules config file for pf and any needed conf files for other daemons (DHCP server, DNS etc.) and starts them all.

        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

        1 Reply Last reply Reply Quote 0
        • R
          richasharma
          last edited by

          sorry

          I think you didn't get my question.

          My question is that that if we are studying the captiveportal.inc file whose location is the /etc/inc/captiveportal.inc
          in this file the the different .db files are called and used

          Can anyone let me know where are those all .db files are located

          1 Reply Last reply Reply Quote 0
          • D
            doktornotor Banned
            last edited by

            So huh, if you are studying that file it's already written there, so what's your trouble?

            
            $ grep \\.db /etc/inc/captiveportal.inc
                                    unlink_if_exists("{$g['vardb_path']}/captiveportal{$cpzone}.db");
                            unlink_if_exists("{$g['vardb_path']}/captiveportal_radius_{$cpzone}.db");
                            unlink_if_exists("{$g['vardb_path']}/captiveportal{$cpzone}.db");
                            unlink_if_exists("{$g['vardb_path']}/captiveportal_radius_{$cpzone}.db");
                            $fd = @fopen("{$g['vardb_path']}/captiveportal_radius_{$cpzone}.db", "w");
                    if (file_exists("{$g['vardb_path']}/captiveportal_radius_{$cpzone}.db")) {
                            $cpradiusdb = file("{$g['vardb_path']}/captiveportal_radius_{$cpzone}.db",
                    $db_path = "{$g['vardb_path']}/captiveportal{$cpzone}.db";
                    if (file_exists("{$g['vardb_path']}/captiveportal_usedmacs_{$cpzone}.db")) {
                            $usedmacs = file("{$g['vardb_path']}/captiveportal_usedmacs_{$cpzone}.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
                    @file_put_contents("{$g['vardb_path']}/captiveportal_usedmacs_{$cpzone}.db", implode("\n", $usedmacs));
            
            
            1 Reply Last reply Reply Quote 0
            • R
              richasharma
              last edited by

              i know all this but i want the location of all this highlighed files

              reply.JPG
              reply.JPG_thumb

              1 Reply Last reply Reply Quote 0
              • P
                phil.davis
                last edited by

                So you need to know the value of:

                $g['vardb_path']
                

                Look in /etc/inc/globals.inc

                "vardb_path" => "/var/db"
                

                find and grep are your friend, use them.

                As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

                1 Reply Last reply Reply Quote 0
                • D
                  doktornotor Banned
                  last edited by

                  Wondering what kind of work is this for. You'd better keep a good backup.  ::)

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