Compare commits
1 Commits
master
...
runsmod-ge
Author | SHA1 | Date |
---|---|---|
Jephté Clain | ca0d2e0882 |
|
@ -338,14 +338,25 @@ function __runsmod_has_vmodule() {
|
|||
[ "${1//%m/}" != "$1" ]
|
||||
}
|
||||
function __runsmod_has_vhost() {
|
||||
# tester si l'url $1 contient une variable d'hôte %h ou %n
|
||||
[ "${1//%h/}" != "$1" -o "${1//%n/}" != "$1" ]
|
||||
}
|
||||
function __runsmod_has_vhost_strict() {
|
||||
# tester si l'url $1 contient une variable d'hôte %h
|
||||
[ "${1//%h/}" != "$1" ]
|
||||
}
|
||||
function __runsmod_has_vhost_generic() {
|
||||
# tester si l'url $1 contient une variable d'hôte %n
|
||||
[ "${1//%n/}" != "$1" ]
|
||||
}
|
||||
function __runsmod_replace1() {
|
||||
# remplacer dans l'url $1 la variable %h par l'hôte complet $2 et
|
||||
# éventuellement la variable %m par le module $3
|
||||
local url="$1"
|
||||
local hostname domain
|
||||
splithost "$2" hostname domain
|
||||
[ -n "$2" ] && url="${url//%h/$2}"
|
||||
[ -n "$2" ] && url="${url//%n/$hostname*$domain}"
|
||||
[ -n "$3" ] && url="${url//%m/$3}"
|
||||
echo "$url"
|
||||
}
|
||||
|
@ -355,6 +366,7 @@ function __runsmod_replace2() {
|
|||
local url="$1"
|
||||
local host="${2%%.*}"
|
||||
[ -n "$host" ] && url="${url//%h/$host}"
|
||||
[ -n "$host" ] && url="${url//%n/$host*}"
|
||||
[ -n "$3" ] && url="${url//%m/$3}"
|
||||
echo "$url"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue