Skip to content

Instantly share code, notes, and snippets.

@wernersmit
Created February 26, 2017 20:22
Show Gist options
  • Save wernersmit/d75f4392710dca4b3db0a10c1479be6e to your computer and use it in GitHub Desktop.
Save wernersmit/d75f4392710dca4b3db0a10c1479be6e to your computer and use it in GitHub Desktop.
Plesk get a list of all domains
#!/bin/bash
# Source: https://support.plesk.com/hc/en-us/articles/213368629--HOW-TO-Get-list-of-domains-and-their-IP-addresses-in-one-query-
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin -Dpsa -e"SELECT dom.id, dom.name, ia.ipAddressId, iad.ip_address FROM domains dom LEFT JOIN DomainServices d ON (dom.id = d.dom_id AND d.type = 'web') LEFT JOIN IpAddressesCollections ia ON ia.ipCollectionId = d.ipCollectionId LEFT JOIN IP_Addresses iad ON iad.id = ia.ipAddressId"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment