Created
April 17, 2019 18:20
-
-
Save ndvo/99b8810a8491cdb110e3c266169176fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
prompt=">>>"; | |
echo "Informe o arquivo que contém a lista de módulos (um por linha). | |
Se deixar em branco, modulos.csv será utilizado"; | |
file_list="modulos.csv"; | |
read file_list | |
history_url="http://updates.drupal.org/release-history/" | |
prefixo="DrupalScript"; | |
echo "Informe a pasta a salvar os arquivos. | |
Se deixar em branco, DrupalScript será utilizado"; | |
read prefixo; | |
api="7.x"; | |
drupal_folder="$prefixo" | |
mkdir $prefixo; | |
mkdir $drupal_folder; | |
for i in `cat $file_list`; | |
do | |
downloadurl=`curl "$history_url$i/$api" |xmllint --dropdtd --xpath "/project/releases/release[1]/download_link" - |sed "s/<download_link>\(.*\)<\/download_link>/\1/"`; | |
for ii in $downloadurl; | |
do | |
curl "$ii" | tar -xzv -C $drupal_folder; | |
done; | |
done; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment