You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
500 B
18 lines
500 B
#!/bin/sh |
|
# |
|
# Get main domain and aliases for a specified account from the Apache |
|
# virtualhost. |
|
# It's part of Evocluster project. |
|
|
|
set -e |
|
|
|
if [ $# -ne 1 ]; then |
|
echo >&2 "Usage: $0 <account>" |
|
exit 1 |
|
fi |
|
|
|
vhost="/etc/apache2/sites-available/$1" |
|
|
|
# Extract ServerName and ServerAlias, remove third level part of domains, |
|
# remove duplicate domains, and print the list to stdout, one domain per line. |
|
perl -ne 'print $3 if (/^\s*Server(Name|Alias)\s+(.*\.)?([^\.]+\.[^\.]+)$/)' $vhost |sort -u
|
|
|