summaryrefslogtreecommitdiffstats
path: root/src/root
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-10-01 10:21:43 -0300
committerRenato Botelho <renato@netgate.com>2015-10-01 10:21:43 -0300
commita5c36eb22154a2f17bba4329ee85627eeb64b664 (patch)
treec3bfe52067f1af8586dd85c2118cb66f55d2b227 /src/root
parent339b88930513dec2bc986df7c0cd7255b6815d56 (diff)
downloadpfsense-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/root')
-rw-r--r--src/root/.shrc4
-rw-r--r--src/root/.tcshrc4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/root/.shrc b/src/root/.shrc
index 6f3c2fc..d3c9208 100644
--- a/src/root/.shrc
+++ b/src/root/.shrc
@@ -1,6 +1,6 @@
-HTTP_PROXY=`/usr/local/bin/xmllint --xpath 'string(//pfsense/system/proxyurl)' /conf/config.xml`
+HTTP_PROXY=`/usr/local/sbin/read_xml_tag.sh string system/proxyurl`
if [ "${HTTP_PROXY}" != "" ]; then
- HTTP_PROXY_PORT=`/usr/local/bin/xmllint --xpath 'string(//pfsense/system/proxyport)' /conf/config.xml`
+ HTTP_PROXY_PORT=`/usr/local/sbin/read_xml_tag.sh string system/proxyport`
if [ "${HTTP_PROXY_PORT}" != "" ]; then
HTTP_PROXY="${HTTP_PROXY}:${HTTP_PROXY_PORT}"
fi
diff --git a/src/root/.tcshrc b/src/root/.tcshrc
index 38cf897..a643e3b 100644
--- a/src/root/.tcshrc
+++ b/src/root/.tcshrc
@@ -20,9 +20,9 @@ if ($term == "xterm" || $term == "vt100" || $term == "vt102" || $term == "vt220"
bindkey "\e[8~" end-of-line # End rxvt/konsole
endif
-set http_proxy=`/usr/local/bin/xmllint --xpath 'string(//pfsense/system/proxyurl)' /conf/config.xml`
+set http_proxy=`/usr/local/sbin/read_xml_tag.sh string system/proxyurl`
if (${http_proxy} != "") then
- set http_proxy_port=`/usr/local/bin/xmllint --xpath 'string(//pfsense/system/proxyport)' /conf/config.xml`
+ set http_proxy_port=`/usr/local/sbin/read_xml_tag.sh string system/proxyport`
if (${http_proxy_port} != "") then
set http_proxy="${http_proxy}:${http_proxy_port}"
endif
OpenPOWER on IntegriCloud