Project

General

Profile

Revision 15ed27d8

Added by Julien Enselme over 9 years ago

Use getopts to print help and to parse script arguments.

View differences:

bin/d7-generate-nginx-map.sh
1 1
#!/bin/sh
2 2

  
3
. /home/assos/bin/scripts-config.sh
3
usage() {
4
    help=<<EOF
5
Generate nginx map from Drupal's sites.php.
4 6

  
5
help=<<EOF
6
Generate nginx map from Drupal's sites.php
7
No option required.
7 8

  
8 9
The left part of the map is $http_host$uri.
9 10
The right part is $subdir.
10 11
EOF
12
    echo -e "${help}"
13
}
14
. /home/assos/bin/print-help-if-required.sh
15

  
16

  
17
. /home/assos/bin/scripts-config.sh
11 18

  
12 19
# Only for sites with url like assos.centrale-marseille.fr/subsite (other sites don't need to be in the map)
13 20
cut -d"'" -f2,4 "${sites_php}" |\

Also available in: Unified diff