Projet

Général

Profil

Paste
Télécharger (636 octets) Statistiques
| Branche: | Révision:

root / bin / d7-generate-nginx-map.sh @ 5fbc698e

1
#!/bin/sh
2

    
3
help=<<EOF
4
Generate nginx map from Drupal's sites.php
5

    
6
The left part of the map is $http_host$uri.
7
The right part is $subdir.
8
EOF
9

    
10
# Only for sites with url like assos.centrale-marseille.fr/subsite (other sites don't need to be in the map)
11
cut -d"'" -f2,4 "${sites_php}" |\
12
 grep '^assos\.centrale-marseille\.fr\.' |\
13
 # In reverse order.
14
 sort -r |\
15
 # Remove the ' at the end of the line.
16
 sed "s/'/ /" |\
17
 # Put slashes where they are needed (beware of tabs).
18
 sed 's/ assos.centrale-marseille.fr\./	/; s/assos.centrale-marseille.fr\./assos.centrale-marseille.fr\//; s/	/\/\.\*\$	\//; s/$/;/' >> "${d7_nginx_map_content}"