What kind of computer do you have? And don't say "a white one."
What kind of computer do you have? And don't say "a white one."
#!/bin/bash -e # -e means stop the script if something goes wrong #your drupal module directory, NO trailing slash MODDIR="/path/to/directory" #generic name for downloaded .tar.gz file so it can be easily removed later FILE=${MODDIR}"/wget.tar.gz" #message if there is an error: "failed," colored red trap 'echo -e "\e[0;31mfailed\e[0m\n"' ERR #if a URL isn't provided, give instructions if [ -z "$1" ] then echo -e "Example Use: \ngetmod http://ftp.drupal.org/files/projects/taxonomy_multi_edit-6.x-1.1.tar.gz" exit fi #"Getting..." colored cyan echo -e "\n\e[1;36mGetting...\e[0m" #download tgz, give it generic name wget $1 -O $FILE #unpack tar -xvf $FILE -C $MODDIR #remove .tar.gz download rm $FILE #"Done" colored green echo -e "\e[0;32mDone\e[0m\n"