Project

General

Profile

Revision d4c4525a

Added by Julien Enselme about 9 years ago

Use drush aliases to loop on all sites instead of sites.

Close #535

View differences:

bin/d7-reset-piwik-variables.sh
1 1
#!/bin/sh
2 2

  
3
site="$1"
4

  
3 5
###### Common to all sites
4
drush -yq en piwik
5
drush -yq vset piwik_url_http "http://piwik.centrale-marseille.fr/"
6
drush -yq vset piwik_url_https "https://piwik.centrale-marseille.fr/"
6
drush @"${site}" -yq en piwik
7
drush @"${site}" -yq vset piwik_url_http "http://piwik.centrale-marseille.fr/"
8
drush @"${site}" -yq vset piwik_url_https "https://piwik.centrale-marseille.fr/"
7 9
# Piwik cache.
8
drush -yq vset piwik_cache 1
9
drush -yq vset piwik_visibility_roles "1"
10
drush @"${site}" -yq vset piwik_cache 1
11
drush @"${site}" -yq vset piwik_visibility_roles "1"
10 12
# Piwik is enable for everyone except the administrator
11
drush -yq vset --format=json piwik_roles '[3]'
12
drush -yq vset piwik_page_title_hierarchy 1
13
drush @"${site}" -yq vset --format=json piwik_roles '[3]'
14
drush @"${site}" -yq vset piwik_page_title_hierarchy 1
13 15
# Activate local search.
14
drush -yq vset piwik_site_search 1
16
drush @"${site}" -yq vset piwik_site_search 1
15 17

  
16 18
##### Specific
17 19
# Note: you can read the piwik site id from the url in piwik
......
79 81
    ftorregrosa)
80 82
	piwik_id=314
81 83
	;;
84
    default)
85
	piwik_id=101
86
	;;
82 87
    *)
83 88
	piwik_id=287
84 89
	;;
85 90
esac
86 91

  
87
# Default is an exception and cannot be treated in the case
88
if [ "$1" = 'default' ] ; then
89
    piwik_id=101
90
fi
91

  
92
drush -yq vset piwik_site_id "${piwik_id}"
92
drush @"${site}" -yq vset piwik_site_id "${piwik_id}"

Also available in: Unified diff