Skip to content

Instantly share code, notes, and snippets.

@mdpuma
Last active December 22, 2016 12:50
Show Gist options
  • Select an option

  • Save mdpuma/8adc9510fa06ebe29a5db2c040a915bf to your computer and use it in GitHub Desktop.

Select an option

Save mdpuma/8adc9510fa06ebe29a5db2c040a915bf to your computer and use it in GitHub Desktop.
vesta useful commands
#!/bin/bash
TTL=600
USERS="`/usr/local/vesta/bin/v-list-users plain | awk '{ print $1 }'`"
for user in $USERS; do
/usr/local/vesta/bin/v-list-dns-domains $user plain | awk '{ print $1 }' | xargs -I{} v-change-dns-domain-ttl $user {} $TTL
done
#!/bin/bash
OLDIP=1.1.1.1
NEWIP=2.2.2.2
USERS="`/usr/local/vesta/bin/v-list-users plain | awk '{ print $1 }'`"
for user in $USERS; do
/usr/local/vesta/bin/v-list-web-domains $user plain | grep $OLDIP | awk '{ print $1 }' | while read domain; do
/usr/local/vesta/bin/v-change-dns-domain-ip $user $domain $NEWIP
/usr/local/vesta/bin/v-change-web-domain-ip $user $domain $NEWIP
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment