Intégration de la branche runsmod-paths

This commit is contained in:
Jephté Clain 2016-05-09 17:55:05 +04:00
commit db76c12a1f
1 changed files with 6 additions and 4 deletions

View File

@ -129,19 +129,21 @@ function __runsmod_fixurl() {
function __runsmod_getpath_from_baseurl() { function __runsmod_getpath_from_baseurl() {
# obtenir le nom correspond à un url de base, utilisable dans un chemin # obtenir le nom correspond à un url de base, utilisable dans un chemin
local url="$1" path userhost user host dummy local url="$1" scheme path userhost user host dummy
case "$url" in case "$url" in
http:*|https:*) http:*|https:*)
path="${url%/}" scheme="${url%%:*}"
path="${url#*://}"
path="${path%/}"
path="${path/:\/\//_}" path="${path/:\/\//_}"
path="${path//\//_}" path="${path//\//_}"
echo "$path" echo "${path}_${scheme}"
return return
;; ;;
*) *)
splitpair "$url" userhost dummy splitpair "$url" userhost dummy
splituserhost "$userhost" user host splituserhost "$userhost" user host
echo "ssh_${user}_${host}" echo "${host}_${user}_ssh"
;; ;;
esac esac
} }