#!/bin/sh NEWDOMAIN=$1 if [ -z "$NEWDOMAIN" ]; then echo $0 new.domain.org exit 1 fi echo $NEWDOMAIN | grep 'http://' > /dev/null if [ $? -eq 0 ]; then echo "don't pass http:// in $NEWDOMAIN" exit 1 fi echo "update wp_options set option_value = 'http://$NEWDOMAIN' where option_name = 'siteurl' or option_name = 'home'" | ./wp-mysql