Projet

Général

Profil

Révision 8550e097

Ajouté par Julien Enselme il y a plus de 9 ans

Command subsitution are not quoted. Quotes posed problems in loop.

Voir les différences:

bin/d7-create-site.sh
26 26
fi
27 27

  
28 28
# "-" is forbidden because it provokes database error.
29
if [ "$(echo "$1" | grep -)" ] ; then
29
if [ $(echo "$1" | grep -) ] ; then
30 30
    echo '"-" is forbidden in the site name'
31 31
    exit 1
32 32
fi
33 33

  
34 34
# Site name length must be lower or equal to 16 due to database limitations.
35
if [ "$(echo "$1" | wc -c)" -gt 16 ] ; then
35
if [ $(echo "$1" | wc -c) -gt 16 ] ; then
36 36
    echo "site name can't have more than 16 characters"
37 37
    exit 1
38 38
fi
......
45 45

  
46 46
###### Initialisation
47 47
cd "${d7_dir}"
48
site_password="$(generate_password)"
48
site_password=$(generate_password)
49 49
site_line_sites_php="\$sites['assos.centrale-marseille.fr.$d7_site_name'] = 'assos.centrale-marseille.fr.$d7_site_name';"
50 50
site_line_aliases_drushrc_php="\$aliases['$d7_site_name'] = array('uri' => 'assos.centrale-marseille.fr/$d7_site_name', 'root' => '/home/assos/drupal7/', );"
51 51
# NB: site_name is initialised in script-config-site.sh
......
60 60
# Backup requirements
61 61
mkdir "${d7_dir_individual_auto_backup}/${dir_site_name}"
62 62
mkdir "${d7_dir_individual_manual_backup}/${dir_site_name}"
63
current_date="$(date "+%Y-%m-%d-%Hh%Mm%Ss")"
63
current_date=$(date "+%Y-%m-%d-%Hh%Mm%Ss")
64 64

  
65 65
# NB : ls sort by considering the 1st characters
66 66
touch "${d7_dir_individual_auto_backup}/${dir_site_name}/${current_date}.${dir_site_name}.sql"

Formats disponibles : Unified diff