Projet

Général

Profil

Paste
Télécharger (922 octets) Statistiques
| Branche: | Révision:

root / bin / usage.sh @ 8550e097

1
#!/bin/sh
2

    
3
. /home/assos/bin/scripts-config.sh
4
. scripts-utils.sh
5

    
6
help="# ARGS: Drupal_version, project_status, project_name\n
7
# List sites that have the project_name with the corresponding project_status.\n
8
# project status: enabled or disabled"
9

    
10
check_arguments "$#" 3 "${help}"
11

    
12
if [ "$1" = d7 ] ; then
13
    cd "${d7_dir_sites}"
14
else
15
    echo Unrecognize version.
16
fi
17

    
18
number_found=0
19

    
20
for dir in $(find . -maxdepth 1 -mindepth 1 -type d ! -name all ! -name languages ! -name images | sort) ; do
21
    # List projects that correspond to the status.
22
    # Keep project_name if listed.
23
    # Count line result. 0 if not listed or 1 if listed.
24
    # Print site_dir if listed.
25

    
26
    cd "${dir}";
27
	if [ 1 -le $(drush pml --status="$2" | grep "$3" | wc -l) ] ; then
28
        echo "${dir}";
29
        number_found=$(($number_found + 1))
30
    fi
31
    cd -
32
done
33

    
34
echo "Number of sites found for project $3 and status $2 : $number_found";