diff options
author | Renato Botelho <renato@netgate.com> | 2015-10-01 10:21:43 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-10-01 10:21:43 -0300 |
commit | a5c36eb22154a2f17bba4329ee85627eeb64b664 (patch) | |
tree | c3bfe52067f1af8586dd85c2118cb66f55d2b227 /src/etc/rc.embedded | |
parent | 339b88930513dec2bc986df7c0cd7255b6815d56 (diff) | |
download | pfsense-a5c36eb22154a2f17bba4329ee85627eeb64b664.zip pfsense-a5c36eb22154a2f17bba4329ee85627eeb64b664.tar.gz |
Introduce read_xml_tag.sh
Create /usr/local/sbin/read_xml_tag.sh, that will read a xml tag from
config file using xmllint. Replace all direct read using cat, grep, sed,
... by this script
Diffstat (limited to 'src/etc/rc.embedded')
-rwxr-xr-x | src/etc/rc.embedded | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/etc/rc.embedded b/src/etc/rc.embedded index 663822d..f08c0ef 100755 --- a/src/etc/rc.embedded +++ b/src/etc/rc.embedded @@ -4,16 +4,16 @@ # For pfSense # Size of /tmp -USE_MFS_TMP_SIZE=`/usr/bin/grep use_mfs_tmp_size /cf/conf/config.xml | /usr/bin/cut -f2 -d'>' | /usr/bin/cut -f1 -d'<'` -if [ ! -z ${USE_MFS_TMP_SIZE} ] && [ ${USE_MFS_TMP_SIZE} -gt 0 ]; then +USE_MFS_TMP_SIZE=$(/usr/local/sbin/read_xml_tag.sh string system/use_mfs_tmp_size) +if [ -n "${USE_MFS_TMP_SIZE}" ] && [ ${USE_MFS_TMP_SIZE} -gt 0 ]; then tmpsize="${USE_MFS_TMP_SIZE}m" else tmpsize="40m" fi # Size of /var -USE_MFS_VAR_SIZE=`/usr/bin/grep use_mfs_var_size /cf/conf/config.xml | /usr/bin/cut -f2 -d'>' | /usr/bin/cut -f1 -d'<'` -if [ ! -z ${USE_MFS_VAR_SIZE} ] && [ ${USE_MFS_VAR_SIZE} -gt 0 ]; then +USE_MFS_VAR_SIZE=$(/usr/local/sbin/read_xml_tag.sh string system/use_mfs_var_size) +if [ -n "${USE_MFS_VAR_SIZE}" ] && [ ${USE_MFS_VAR_SIZE} -gt 0 ]; then varsize="${USE_MFS_VAR_SIZE}m" else varsize="60m" |