summaryrefslogtreecommitdiffstats
path: root/src/etc/rc.php_ini_setup
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-10-01 13:26:03 -0300
committerRenato Botelho <renato@netgate.com>2015-10-01 13:27:30 -0300
commite4121dde007c66ec9e2f4c9ecb4a94d38c5fa6cc (patch)
tree211ec70afaea8c0610814f461dd3b040f157c158 /src/etc/rc.php_ini_setup
parent3ece711605c23bda1176e341d8f96417d3b82b5d (diff)
downloadpfsense-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.php_ini_setup')
-rwxr-xr-xsrc/etc/rc.php_ini_setup27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/etc/rc.php_ini_setup b/src/etc/rc.php_ini_setup
index 2fd5add..b4038e7 100755
--- a/src/etc/rc.php_ini_setup
+++ b/src/etc/rc.php_ini_setup
@@ -76,16 +76,7 @@ fi
# Set upload directory
if [ "$PLATFORM" = "nanobsd" ]; then
- globals_inc="/etc/inc/globals.inc"
- if [ -f /etc/inc/globals_override.inc ]; then
- globals_inc="/etc/inc/globals_override.inc ${globals_inc}"
- fi
- UPLOADTMPDIR=$(cat ${globals_inc} | \
- grep upload_path | \
- head -n 1 | \
- sed 's/^.*=>* *//; s/["\;,]*//g')
-
- UPLOADTMPDIR=${UPLOADTMPDIR:-"/root"}
+ UPLOADTMPDIR=$(/usr/local/sbin/read_global_var upload_path "/root")
else
UPLOADTMPDIR="/tmp"
fi
@@ -177,20 +168,8 @@ if [ -z "${TIMEZONE}" ]; then
fi
if [ -z "${TIMEZONE}" ]; then
- # Last option, use default value
- globals_inc="/etc/inc/globals.inc"
- if [ -f /etc/inc/globals_override.inc ]; then
- globals_inc="/etc/inc/globals_override.inc ${globals_inc}"
- fi
- TIMEZONE=$(cat ${globals_inc} | \
- grep default_timezone | \
- head -n 1 | \
- sed 's/^.*=>* *//; s/["\;,]*//g')
-fi
-
-if [ -z "${TIMEZONE}" ]; then
- # It it's still blank, lets avoid PHP errors
- TIMEZONE="Etc/UTC"
+ # Last option, use default value from $g or Etc/UTC
+ TIMEZONE=$(/usr/local/sbin/read_global_var default_timezone "Etc/UTC")
fi
# Get a loaded module list in the stock php
OpenPOWER on IntegriCloud