Send_gmail_after_startup.sh always runs twice



  • 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?



  • 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.


Log in to reply