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

    Send_gmail_after_startup.sh always runs twice

    Scheduled Pinned Locked Moved General pfSense Questions
    2 Posts 1 Posters 1.4k 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.
    • C
      clart
      last edited by

      I installed "send_gmail_after_startup" found in GitHub and it works very well - many thanks for this.
      https://github.com/x-ian/pfSensePortal

      The pfSense docs [ [url=http://doc.pfsense.org/index.php/Executing_commands_at_boot_time]http://doc.pfsense.org/index.php/Executing_commands_at_boot_time ] state the following; "You can also place any shell script in the /usr/local/etc/rc.d/ directory. The filename must end in .sh and it must be marked as executable (chmod +x myscript.sh). Every shell script ending in .sh in this directory will be executed at boot time."

      I did this, but the problem is that on boot up it always runs twice and sends 2 emails.
      This is a nuisance because I send email to SMS gateway and its wasting the SMS credits.

      How to fix please?

      1 Reply Last reply Reply Quote 0
      • C
        clart
        last edited by

        Update - not a fix to the actual problem, but a workaround:

        • installed the package "Shellcmd".
        • renamed the script without the ".sh" extension.
        • added this into "Shellcmd: settings" : /usr/local/etc/rc.d/send_gmail_after_startup

        Now it only runs once as required.

        • same goes for any other custom scripts needed to run once at startup.

        Hope that helps anyone else experiencing the same problem.

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