diff options
author | Renato Botelho <renato@netgate.com> | 2015-10-01 13:26:03 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-10-01 13:27:30 -0300 |
commit | e4121dde007c66ec9e2f4c9ecb4a94d38c5fa6cc (patch) | |
tree | 211ec70afaea8c0610814f461dd3b040f157c158 /src/etc/rc.initial | |
parent | 3ece711605c23bda1176e341d8f96417d3b82b5d (diff) | |
download | pfsense-e4121dde007c66ec9e2f4c9ecb4a94d38c5fa6cc.zip pfsense-e4121dde007c66ec9e2f4c9ecb4a94d38c5fa6cc.tar.gz |
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
Diffstat (limited to 'src/etc/rc.initial')
-rwxr-xr-x | src/etc/rc.initial | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/etc/rc.initial b/src/etc/rc.initial index b6ef02c..3d20ff1 100755 --- a/src/etc/rc.initial +++ b/src/etc/rc.initial @@ -44,17 +44,8 @@ fi /etc/rc.banner -globals_inc="/etc/inc/globals.inc" -if [ -f /etc/inc/globals_override.inc ]; then - globals_inc="/etc/inc/globals_override.inc ${globals_inc}" -fi -product=$(cat ${globals_inc} | \ - grep product_name | \ - head -n 1 | \ - sed 's/^.*=>* *//; s/["\;,]*//g') - -# product cannot be blank -product=${product:-"pfSense"} +# Read product_name from $g, defaults to pfSense +product=$(/usr/local/sbin/read_global_var product_name pfSense) # Check to see if SSH is running. if pgrep -q -a -F /var/run/sshd.pid sshd >/dev/null 2>&1; then |