forked from ylynfatt/plumber
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplumber.sh
executable file
·73 lines (61 loc) · 1.36 KB
/
plumber.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
# Plumber
# =======
#
# A collection of bash scripts using [Drush](http://drupal.org/project/drush) to help manage a Drupal Multi-Site setup.
#
function get_sites() {
find . -maxdepth 1 -type d -print | grep -v '/all$' | grep -v '/default$' | grep -v '\.$'
}
# Turn caching on or off for all sites and set the cache lifetime
function caching() {
sites=get_sites
for site in $sites
do
echo ----------
echo $site
cd $site
drush variable-set --always-set cache $1
drush variable-set --always-set cache_lifetime $2
drush variable-set --always-set preprocess_css $1
drush variable-set --always-set preprocess_js $1
cd ../
done
}
# Put all sites in maintenance mode
function maintenance() {
sites=get_sites
for site in $sites
do
echo ----------
echo $site
cd $site
drush variable-set --always-set site_offline $1
cd ../
done
}
# For each site update Drupal core and any modules that need updating
function updatedb() {
sites=get_sites
for site in $sites
do
echo ---------
echo $site
cd $site
drush -y updatedb
echo Site: $site has been udpated, look above for any errors that may have occurred
cd ../
done
}
# Set the default theme for all Drupal sites
function default_theme() {
sites=get_sites
for site in $sites
do
echo $site
cd $site
drush vset --always-set theme_default $1
cd ../
done
}
$1 $2 $3