#!/bin/bash if [ $# != "1" ] then echo "You need to run this script with a theme-id as argument" else if [ `whoami` != "root" ] then echo "You need to run this script as root!" else function check_status { if [ $? != 0 ] then echo "failed!" exit else echo "done!" fi } cd /home/httpd/html/62766/wp-content/themes/ echo -n "Downloading file... " wget http://themes.wordpress.net/download.php?theme=$1 > /dev/null 2>&1 check_status echo -n "Unzipping file... " unzip -o "download.php?theme=$1" > /dev/null 2>&1 check_status echo "Removing downloaded file... " rm -i "download.php?theme=$1" echo "All done. Theme is ready to be used!" fi fi