Files
tareo-scripts/server/list-web-users.sh

19 lines
487 B
Bash
Raw Normal View History

#!/bin/bash
# echo "* * * * * root /root/scripts/server/list-web-users.sh" > /etc/cron.d/list-web-users
DOMAINROOT="mit.tareo-tz.org"
2015-06-12 12:59:29 +03:00
WEBDIR="/var/www/html/html"
> $WEBDIR/websites.txt
find /var/www/* -maxdepth 0 -type d -print0 | while IFS= read -r -d $'\0' line; do
USER=$(basename $line)
DOMAIN="$USER.$DOMAINROOT"
2015-06-12 13:04:33 +03:00
if [ ! "$USER" == "html" ] && [ ! "$USER" == "pma" ]; then
echo "<li><a href=\"http://$DOMAIN\">$DOMAIN</a></li>" >> $WEBDIR/websites.txt
fi
done