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

21 lines
617 B
Bash
Raw Permalink Normal View History

#!/bin/bash
2016-02-26 02:22:04 +01:00
# echo "* * * * * root /root/tareo-scripts/server/list-web-users.sh" > /etc/cron.d/list-web-users
DOMAINROOT="mit.tareo-tz.org"
2015-06-24 12:45:37 +03:00
INTDOMAINROOT="web.intra"
2016-02-26 02:22:04 +01:00
WEBDIR="/var/www/start/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-24 12:45:37 +03:00
INTDOMAIN="$USER.$INTDOMAINROOT"
2016-02-26 02:22:04 +01:00
if [ ! "$USER" == "start" ] && [ ! "$USER" == "pma" ]; then
2015-06-24 12:45:37 +03:00
echo "<li><a href=\"http://$INTDOMAIN\">$INTDOMAIN</a> (alternatively <a href=\"http://$DOMAIN\">$DOMAIN</a>)</li>" >> $WEBDIR/websites.txt
fi
done