summaryrefslogtreecommitdiffstats
path: root/initramfs/initrd-stuff/etc/functions
diff options
context:
space:
mode:
authorMichael Janczyk2008-06-17 16:40:13 +0200
committerMichael Janczyk2008-06-17 16:40:13 +0200
commite4bd3b3670a8bd9f5dd3cbb438e994911a810635 (patch)
tree3669ce33b5477a5154f0e79d88acd6399032f64b /initramfs/initrd-stuff/etc/functions
parentchanged uri_token function. simpler solution to ticket #232 (diff)
downloadcore-e4bd3b3670a8bd9f5dd3cbb438e994911a810635.tar.gz
core-e4bd3b3670a8bd9f5dd3cbb438e994911a810635.tar.xz
core-e4bd3b3670a8bd9f5dd3cbb438e994911a810635.zip
back to other solution of ticket #232, since pattern matching has to be changed too for this solution.
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1884 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs/initrd-stuff/etc/functions')
-rw-r--r--initramfs/initrd-stuff/etc/functions11
1 files changed, 9 insertions, 2 deletions
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions
index 0d9e20a2..a142f5f2 100644
--- a/initramfs/initrd-stuff/etc/functions
+++ b/initramfs/initrd-stuff/etc/functions
@@ -93,10 +93,16 @@ else
rest="$var"
prot=""
fi
+# remove temporary '::' from path, since it conflicts with port specification
+if strinstr "::" "$rest" ; then
+ rest=$(echo $rest | sed -e 's,::,§§§§§,g')
+elif strinstr "\:\:" "$rest" ; then
+ rest=$(echo $rest | sed -e 's,\:\:,§§§§§,g')
+fi
# get the server IP or name and port - URI authority
# you get the path or other token without leading "/" - add it later if
# needed (fixme: port might be broken)
-if echo "$rest" grep -e "[0-9,a-z]:[0-9]" >/dev/null 2>&1; then
+if strinstr ":" "$rest" ; then
server="${rest%:*}"
rest="${rest#*:}"
path="${rest#*/}"
@@ -117,7 +123,8 @@ fi
case "$2" in
prot) echo "$prot" ;;
server) echo "$server" ;;
- path) echo "$path" ;;
+ # add '::' again to path
+ path) echo "$path" | sed -e 's,§§§§§,\:\:,g' ;;
port) echo "$port" ;;
query) echo "$query" ;;
esac