OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 16.7 Legacy Series »
  • question about adding scripts to opnsense
« previous next »
  • Print
Pages: [1]

Author Topic: question about adding scripts to opnsense  (Read 2948 times)

xmichielx

  • Newbie
  • *
  • Posts: 44
  • Karma: 0
    • View Profile
question about adding scripts to opnsense
« on: October 20, 2016, 11:07:47 am »
Hi,

I want to store a bash script on the opnsense filesystem without it get overwritten after an upgrade.
It's a script that downloads an ads block list for unbound and stores it in /var/unbound/ads.conf and reloads unbound.

My question; how do I make the script and the ads.conf file persistent on the opnsense file system so it survives an upgrade.
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13929
  • Karma: 1208
    • View Profile
Re: question about adding scripts to opnsense
« Reply #1 on: October 21, 2016, 10:24:56 am »
Hi xmichielx,

Normally, no user scripts are overwritten. /var/unbound, however, is a private chroot that is likely to be reset to make its content deterministic.

Where are you storing the script now and how do you trigger it?

Are you using a Nano install?


Cheers,
Franco
Logged

xmichielx

  • Newbie
  • *
  • Posts: 44
  • Karma: 0
    • View Profile
Re: question about adding scripts to opnsense
« Reply #2 on: October 23, 2016, 08:58:11 pm »
Hi Franco,

I am storing the script in /usr/local/bin/get-ads.sh, I ran it manually but am looking to add it to crontab.
The script creates a /var/unbound/ads.conf where all known ads servers are redirected to 127.0.0.1.
It is OK if that file is removed during an upgrade since the script/cronjob will recreate it the next day.
I am using the amd64 with serial install on an apu2.

Cheers,

Michiel
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 16.7 Legacy Series »
  • question about adding scripts to opnsense
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2