Post boot script



  • @jimp  - I have a need for a 'post-boot' script that gets run last, even after the beep!

    I have modified the pfsense-rc script to call my 'post-boot' script, at present all my 'post-boot' script does is trigger pfblockerNG update, it appears to work fine. Is there any reason why I should not do this?



  • Would shellcmd package be of use to run your command? Or it aint firing at the right moment?

    On the other hand, why would you use such a thing? Doesnt pfBlocker automatically update when its scheduled to do so.?



  • @PiBa:

    Would shellcmd package be of use to run your command? Or it aint firing at the right moment?

    Correct, fires too early, and I don't wan't to use sleeps or loops in the called script to slow it down.

    @PiBa:

    On the other hand, why would you use such a thing? Doesnt pfBlocker automatically update when its scheduled to do so.?

    Yes it does, and that's not a problem, the problem is on reboot.



  • Have a look what the cron-package can do for you.
    cron has a @reboot command that will execute programs at boot. Throwing in an extra "sleep 60" to delay 60 seconds more before running your program or script.



  • @Gertjan:

    Have a look what the cron-package can do for you.
    cron has a @reboot command that will execute programs at boot. Throwing in an extra "sleep 60" to delay 60 seconds more before running your program or script.

    I'll take a look. I think my current solution is more elegant  though. 8)



  • I agree.
    But this :
    @marjohn56:

    I have modified the pfsense-rc script to call my 'post-boot' script, …..

    isn't known as elegant ;) an upgrade will blow you out of the water.



  • @Gertjan:

    Have a look what the cron-package can do for you.
    cron has a @reboot command that will execute programs at boot. Throwing in an extra "sleep 60" to delay 60 seconds more before running your program or script.

    I cannot see anything about @boot in the cron 'Add a cron schedule' page, what am I missing?



  • @Gertjan:

    I agree.
    But this :
    @marjohn56:

    I have modified the pfsense-rc script to call my 'post-boot' script, …..

    isn't known as elegant ;) an upgrade will blow you out of the water.

    It's a patch I've written, it's set to patch automatically on updates.



  • @marjohn56:

    It's a patch I've written, it's set to patch automatically on updates.
    Patch ID:  74b2369

    Nice ! THE proper way to go.

    cron : I looked at "freebsd man cron" ….
    edit : Installed this cron package. You're right. The GUI wrapper doesn't permit commands like "@boot". Sorry, useless idea.



  • @marjohn56:

    the problem is on reboot.

    What problem?



  • @PiBa:

    @marjohn56:

    the problem is on reboot.

    What problem?

    No pfBlocker rules are loaded. I have to do a force update. My patch and script means I do not have to anymore, it's done automatically.