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/scripts-utils.sh
42 42
    echo "$site_password"
43 43
}
44 44

  
45
count_d7_sites() {
46
    find "${d7_dir_sites}" -type d ! -name all -maxdepth 1 | wc -l
47
}
48

  
49 45
check_arguments() {
50 46
    # ARGS: number of arguments passed to script, number of arguments required, [help text]
51 47
    if [ "$1" -lt "$2"  ] ; then
......
116 112
    return 1
117 113
}
118 114

  
119
get_site_name_from_dir_name() {
120
    # ${1##*/} get the part after the last / ie default in /home/assos/drupal7/sites/default
121
    # $(tr '.' '\n' | tail -n 1) get the part after the last .
122
    # ie tvp in assos.centrale-marseille.fr.tvp
123
    echo ${1##*/} | tr '.' '\n' | tail -n 1
115
get_site_dir_from_name() {
116
    if [ "$1" = 'default' ]; then
117
	dir='default'
118
    else
119
	dir="assos.centrale-marseille.fr.$1"
120
    fi
121

  
122
    echo "${dir}"
123
}
124

  
125
get_absolute_site_dir_from_name() {
126
    dir=$(get_site_dir_from_name "$1")
127
    echo "${d7_dir_sites}/${dir}"
128
}
129

  
130
sites_list() {
131
    drush sa --format=csv --fields="name","uri" | awk '{FS=","; if ($2 != "") { print $1;}}' | sort
124 132
}

Also available in: Unified diff