wpstupidbashI wrote this little script because some plugins I use on all my blogs get updated every day yet don’t have a public source control. Shame on those devs…
To Use
Create a file called dirfile.txt in the same directory you save the script.
Add the full paths to each of your target directories and save.
Run the script and paste in the url to the zip you want to download and extract. That’s it ;)

#!/bin/bash
#                      |         _)  |        |        |
#            \   |  |  | /   -_)  |   _|   _` |   _ \   _|   _ \   _| _` |
#         _| _| \_,_| _\_\ \___| _| \__| \__,_| \___/ \__| \___/ _| \__, |
#                                                                   ____/
#Set your wp-content/plugins list here. Contents Ex: /full/pathto/wp-content/plugins/ (one per line)
DIRFILE="../dirfile.txt"
function mkcd() {
  [ -n "$1" ] && mkdir -p "$@" && cd "$1";
}
echo -n "Paste or type the url to the file download: "
read -e DOWNLOAD
mkcd $RANDOM-$RANDOM-$RANDOM && wget -m -nd $DOWNLOAD
for dirs in $(cat $DIRFILE); do unzip -o *.zip -d ${dirs}; done

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

© 2010 nukeitdotorg Suffusion WordPress theme by Sayontan Sinha

Powered by CDN Rewrites