diff options
-rw-r--r-- | initramfs/initrd-stuff/etc/functions | 11 |
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 |