1 |
5fbc698e
|
Julien Enselme
|
#!/bin/sh
|
2 |
|
|
|
3 |
73a967a6
|
Julien Enselme
|
. /home/assos/bin/scripts-config.sh
|
4 |
|
|
|
5 |
5fbc698e
|
Julien Enselme
|
help=<<EOF
|
6 |
|
|
Generate nginx map from Drupal's sites.php
|
7 |
|
|
|
8 |
|
|
The left part of the map is $http_host$uri.
|
9 |
|
|
The right part is $subdir.
|
10 |
|
|
EOF
|
11 |
|
|
|
12 |
|
|
# Only for sites with url like assos.centrale-marseille.fr/subsite (other sites don't need to be in the map)
|
13 |
|
|
cut -d"'" -f2,4 "${sites_php}" |\
|
14 |
|
|
grep '^assos\.centrale-marseille\.fr\.' |\
|
15 |
|
|
# In reverse order.
|
16 |
|
|
sort -r |\
|
17 |
|
|
# Remove the ' at the end of the line.
|
18 |
|
|
sed "s/'/ /" |\
|
19 |
|
|
# Put slashes where they are needed (beware of tabs).
|
20 |
|
|
sed 's/ assos.centrale-marseille.fr\./ /; s/assos.centrale-marseille.fr\./assos.centrale-marseille.fr\//; s/ /\/\.\*\$ \//; s/$/;/' >> "${d7_nginx_map_content}" |