aboutsummaryrefslogtreecommitdiffstats
path: root/datarouter-prov/src/main/resources/misc/provcmd
diff options
context:
space:
mode:
authorFiachra Corcoran <fiachra.corcoran@ericsson.com>2018-08-09 00:04:29 +0100
committerRonan Keogh <ronan.keogh@ericsson.com>2018-08-17 17:58:55 +0100
commite06737d701ff5b3dcab311f4337ce40be52c966e (patch)
tree81d76de3d400c99c531147c242fc702506329140 /datarouter-prov/src/main/resources/misc/provcmd
parent49fbf9a09d244bbdc19783d9ff10cd03cd89640a (diff)
Update for OOM integration
Issue-ID: DMAAP-107 Change-Id: Iff9f93040f7b3120cffb5755adc693e24de991a7 Signed-off-by: Fiachra Corcoran <fiachra.corcoran@ericsson.com>
Diffstat (limited to 'datarouter-prov/src/main/resources/misc/provcmd')
-rw-r--r--datarouter-prov/src/main/resources/misc/provcmd15
1 files changed, 15 insertions, 0 deletions
diff --git a/datarouter-prov/src/main/resources/misc/provcmd b/datarouter-prov/src/main/resources/misc/provcmd
index 75d0bffa..e3654eb9 100644
--- a/datarouter-prov/src/main/resources/misc/provcmd
+++ b/datarouter-prov/src/main/resources/misc/provcmd
@@ -19,6 +19,21 @@
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+urlencode() {
+ local data
+ if [[ $# != 1 ]]; then
+ echo "Usage: $0 string-to-urlencode"
+ return 1
+ fi
+ data="$(curl -s -o /dev/null -w %url_effective --get --data-urlencode "$1" "")"
+ if [[ $? != 3 ]]; then
+ echo "Unexpected error" 1>&2
+ return 2
+ fi
+ echo "${data##/?}"
+ return 0
+}
+export urlencode
PATH=/opt/app/datartr/bin:/bin:/usr/bin:$PATH
PROVCMD="$0"