From ddd9c989d001f67f1d326b852623094a496b0155 Mon Sep 17 00:00:00 2001 From: mxmehl Date: Fri, 12 Jun 2015 12:43:36 +0300 Subject: [PATCH] dynamic index site to list all active websites --- server/index.php | 21 +++++++++++++++++++++ server/list-web-users.sh | 7 ++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 server/index.php diff --git a/server/index.php b/server/index.php new file mode 100644 index 0000000..46625f4 --- /dev/null +++ b/server/index.php @@ -0,0 +1,21 @@ + + +Welcome to MIT + + +

Welcome

+

...to the internal website storage server of Moshi Institute of Technology.

+ +

For Students

+

To view the publicly shared files, please click here.

+

Please visit the students' own websites on this server for more.

+

There're currently following websites active:

+ + +

For Teachers

+

Teachers can visit the internal shared files (password protected). Please visit this website.

+ + + diff --git a/server/list-web-users.sh b/server/list-web-users.sh index ccc5af6..b29cc97 100755 --- a/server/list-web-users.sh +++ b/server/list-web-users.sh @@ -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 "

  • $DOMAIN
  • " + echo "
  • $DOMAIN
  • " >> $WEBDIR/websites.txt fi done