Revision e4121dde
Added by Renato Botelho almost 10 years ago
src/etc/rc.firmware_auto | ||
---|---|---|
10 | 10 |
FMFILENAME=$2 |
11 | 11 |
FETCHFILENAME=$1/$2 |
12 | 12 |
|
13 |
globals_inc="/etc/inc/globals.inc" |
|
14 |
if [ -f /etc/inc/globals_override.inc ]; then |
|
15 |
globals_inc="/etc/inc/globals_override.inc ${globals_inc}" |
|
16 |
fi |
|
17 |
product=$(cat ${globals_inc} | \ |
|
18 |
grep product_name | \ |
|
19 |
head -n 1 | \ |
|
20 |
sed 's/^.*=>* *//; s/["\;,]*//g') |
|
21 |
|
|
22 |
# product cannot be blank |
|
23 |
product=${product:-"pfSense"} |
|
13 |
# Read product_name from $g, defaults to pfSense |
|
14 |
product=$(/usr/local/sbin/read_global_var product_name pfSense) |
|
24 | 15 |
|
25 | 16 |
# wait 5 seconds before beginning |
26 | 17 |
sleep 5 |
Also available in: Unified diff
Introduce read_global_var:
- Add a new script, read_global_var, that returns the value of any item
contained in global array $g
- Replace all grep and sed magic from shell scripts