Révision 40dfeef4
Ajouté par Julien Enselme il y a plus de 10 ans
bin/d7-create-site.sh | ||
---|---|---|
39 | 39 |
site_line_aliases_drushrc_php="\$aliases['$d7_site_name'] = array('uri' => 'assos.centrale-marseille.fr/$d7_site_name', 'root' => '/users/guest/assos/drupal7/', );" |
40 | 40 |
|
41 | 41 |
# Check if site already exists. |
42 |
if site_exists ; then |
|
42 |
if site_exists $d7_site_name ; then
|
|
43 | 43 |
exit 1 |
44 | 44 |
fi |
45 | 45 |
|
bin/d7-sync-site.sh | ||
---|---|---|
15 | 15 |
. /users/guest/assos/bin/scripts-utils.sh |
16 | 16 |
|
17 | 17 |
# Create site if necessary |
18 |
if ! site_exists ; then |
|
18 |
if ! site_exists $2 ; then
|
|
19 | 19 |
echo "$2 does not exit. We will create it" |
20 | 20 |
d7-create-site.sh $2 --no-init-database |
21 | 21 |
fi |
bin/scripts-utils.sh | ||
---|---|---|
102 | 102 |
|
103 | 103 |
site_exists() { |
104 | 104 |
# Check if site database exists. |
105 |
if mysql --defaults-extra-file=$myassos_cnf -e "USE $d7_site_name" 2>/dev/null ; then
|
|
106 |
echo "Database $d7_site_name already exists"
|
|
105 |
if mysql --defaults-extra-file=$myassos_cnf -e "USE $1" 2>/dev/null ; then
|
|
106 |
echo "Database $1 already exists"
|
|
107 | 107 |
exit 1 |
108 | 108 |
fi |
109 | 109 |
|
110 | 110 |
# Check if site folder already exists. |
111 |
if [ -d $d7_site_dir ] ; then |
|
112 |
echo "Folder $d7_site_dir already exists" |
|
111 |
dir=$d7_dir_sites/$1 |
|
112 |
if [ -d "$dir" ] ; then |
|
113 |
echo "Folder $dir already exists" |
|
113 | 114 |
exit 1 |
114 | 115 |
fi |
115 | 116 |
} |
Formats disponibles : Unified diff
Correct variable name error and function call error.