Skip to content

Instantly share code, notes, and snippets.

@neidiom
Forked from agarzon/googleize.sh
Last active February 19, 2018 17:08
Show Gist options
  • Select an option

  • Save neidiom/a433eb3b3a1093329152e743b9b7fe2f to your computer and use it in GitHub Desktop.

Select an option

Save neidiom/a433eb3b3a1093329152e743b9b7fe2f to your computer and use it in GitHub Desktop.
Change a domain's ip address from old one to new one via Plesk cli dns util
#!/bin/bash
if [ -z "$1" ]
then
echo "Please provide a domain name as argument"
exit 1
fi
DOMAIN=$1
IP=`dig +short A $DOMAIN`
/usr/local/psa/bin/dns -d ${DOMAIN} -a $DOMAIN -ip ${IP}
/usr/local/psa/bin/dns -d ${DOMAIN} -a 'mail' -ip ${IP}
/usr/local/psa/bin/dns -d ${DOMAIN} -a 'webmail' -ip ${IP}
#
/usr/local/psa/bin/dns --off ${DOMAIN}
/usr/local/psa/bin/dns --on ${DOMAIN}
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment