dynamic index site to list all active websites
This commit is contained in:
@@ -1,13 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
# echo "* * * * * root /root/scripts/server/list-web-users.sh" > /etc/cron.d/list-web-users
|
||||
|
||||
DOMAINROOT="mit.tareo-tz.org"
|
||||
WEBDIR="/var/www/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"
|
||||
if [ ! "$USER" == "html" ]; then
|
||||
echo "<li><a href=\"http://$DOMAIN\">$DOMAIN</a></li>"
|
||||
echo "<li><a href=\"http://$DOMAIN\">$DOMAIN</a></li>" >> $WEBDIR/websites.txt
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user