Created
February 26, 2017 20:22
-
-
Save wernersmit/d75f4392710dca4b3db0a10c1479be6e to your computer and use it in GitHub Desktop.
Plesk get a list of all domains
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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