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

    Automatic updates for squidguard blacklist

    Cache/Proxy
    4
    6
    3.9k
    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.
    • S
      SourceFinder
      last edited by

      As far as I discovered, blacklists in squidguard have to be updated manually. Would be perfect if there was a possibility for automatic updates, to keep users on the safe side.

      1 Reply Last reply Reply Quote 1
      • A
        aGeekhere
        last edited by

        https://forum.pfsense.org/index.php?topic=35479.0

        Never Fear, A Geek is Here!

        1 Reply Last reply Reply Quote 1
        • S
          SourceFinder
          last edited by

          Thanks Geek!

          It was a few minutes puzzling, but I think it's configured right now. The only thing left is to Save and Apply the squidguard configuration to apply the new database. I'm looking for a script to do that (or a script to reboot pfsense once a day at, for example, 4 a.m. Any solutions/suggestions?

          Greetings, Sourcefinder

          1 Reply Last reply Reply Quote 1
          • S
            SourceFinder
            last edited by

            And, I'm ashamed to admit, but I don't know in what log to look to check wether the database has been updated…

            1 Reply Last reply Reply Quote 1
            • D
              DBMandrake
              last edited by DBMandrake

              The original thread referenced here is locked so I thought I would post a slight improvement to the original method described of copying the update script manually and creating a cronjob. No need to log in with SSH, just create a cron job with this exact command line which runs as root:

              /bin/cp /tmp/squidGuard_blacklist_update.sh /usr/local/bin/;/usr/local/bin/squidGuard_blacklist_update.sh
              

              cb540418-9623-4e2c-88d1-6c72ff58f327-image.png

              Why do the copy every time in the cron job ? Simple - if you manually copy the script one time and ever change the blacklist download URL in the future, the cron job will keep using the original URL at the time you copied the script as it is embedded in the script...this would lead to confusing and unexpected results given that the Download button would use the new URL.

              Running the script directly from /tmp is not an option either, because the script is only created in /tmp when the manual blacklist download button is pressed and is gone again if you ever reboot the device, so automatic updating would stop working after a reboot until you pressed the manual download button because the script would be missing.

              Attempting to copy the file every time is simple and is the best of both worlds - if the URL was updated, as long as you pressed the manual download button at least once before the next scheduled auto update and also did not reboot the device before that scheduled auto update, the file would be copied and automatic updates would work from then on with that URL even after reboots. (The file copy fails silently in the after-reboot but before manual download scenario but the previous copy is still there in /usr/local/bin)

              JonathanLeeJ 1 Reply Last reply Reply Quote 2
              • D DBMandrake referenced this topic on
              • D DBMandrake referenced this topic on
              • JonathanLeeJ
                JonathanLee @DBMandrake
                last edited by

                @dbmandrake
                799ecc95-da12-4329-8986-86e3b8bbb51d-image.png

                61216ded-5a50-4492-b951-3825dfab0c9d-image.png

                Thanks for the info, it's working great. 9:29 AM test ran automatically.

                Make sure to upvote

                1 Reply Last reply Reply Quote 0
                • jimpJ jimp moved this topic from Forum Feedback on
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.