Commit 15d88980 authored by Ad Schellevis's avatar Ad Schellevis

(rc) add [module]_opnsense_bootup_run tag to rc config to prepare the environment if necessary

for example, if squid needs some directories to exists before initial run after boot, it could set this in /etc/rc.d.conf/squid

squid_opnsense_bootup_run="/usr/local/opnsense/scripts/proxy/setup.sh"

which effectively results in setup.sh being started followed by the normal service squid start

disadvantage of this, both the service template and the rc system needed to be aware of the setup.
advantage, all services which don't need special preperation are configured as they would be on normal FreeBSD
parent 280a00d8
...@@ -20,6 +20,13 @@ ls /usr/local/etc/rc.d/* | while read rc_filename; do ...@@ -20,6 +20,13 @@ ls /usr/local/etc/rc.d/* | while read rc_filename; do
# start/stop service # start/stop service
if [ "$is_enabled" == "YES" ]; then if [ "$is_enabled" == "YES" ]; then
if [ "$1" == "start" ]; then
pre_run_var="`basename $rc_filename`_opnsense_bootup_run"
eval "pre_run=\$"$pre_run_var""
if [ ! -z "$pre_run" ]; then
eval "$pre_run"
fi
fi
$rc_filename $1 $rc_filename $1
fi fi
done done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment