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 4914 times)
xmichielx
Newbie
Posts: 44
Karma: 0
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: 17668
Karma: 1611
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
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