Commit 80e97804 authored by Nathalie Furmento's avatar Nathalie Furmento

scripts/createWebServer.sh: redirect to files.inria.fr/starpu

parent f180220a
Pipeline #160345 passed with stages
in 1 minute and 25 seconds
......@@ -7,11 +7,15 @@ createRedirectFile()
src=$1
dst=$2
(cat <<EOF
<html>
<head>
<title>Page has moved!</title>
<meta http-equiv="Refresh" content="0; URL=$dst" />
</head>
<body>
<a href="$dst">Page has moved</a>
</body>
</html>
EOF
) > public/$src
}
......@@ -39,19 +43,20 @@ updateFileLinks()
{
for x in $(grep -rs 'href="\/files/' public | tr ' ' '\012' | tr '\t' '\012' | grep href | sed -e 's/href="//' -e 's/".*//' -e 's/#.*//' | sort | uniq)
do
echo "create redirect for $x"
dst=$(echo "http://files.inria.fr/starpu$x" | sed 's:files/::')
echo "create redirect from $x to $dst"
case "$x" in
*pdf) for f in $(grep -rsl $x public) ; do sed -i 's;href="'$x'";href="http://starpu.gforge.inria.fr'$x'";g' $f ; done ;;
*gz) for f in $(grep -rsl $x public) ; do sed -i 's;href="'$x'";href="http://starpu.gforge.inria.fr'$x'";g' $f ; done ;;
*/) createRedirectDir $x "http://starpu.gforge.inria.fr$x" ;;
*) mkdir -p public/$(dirname $x) && createRedirectFile $x "http://starpu.gforge.inria.fr$x" ;;
*pdf) for f in $(grep -rsl $x public) ; do sed -i 's;href="'$x'";href="'$dst'";g' $f ; done ;;
*gz) for f in $(grep -rsl $x public) ; do sed -i 's;href="'$x'";href="'$dst'";g' $f ; done ;;
*/) createRedirectDir $x "$dst" ;;
*) mkdir -p public/$(dirname $x) && createRedirectFile $x "$dst" ;;
esac
done
# for f in $(grep -rsl 'href="/files' public)
# do
# echo update file links in $f
# sed -i 's/href="\/files/href="http:\/\/starpu.gforge.inria.fr\/files/g' $f
# sed -i 's/href="\/files/href="http:\/\/files.inria.fr/starpu\/files/g' $f
# done
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment