Added separate config file, and bummped version

This commit is contained in:
Ubergeek 2019-11-05 00:09:27 +00:00
parent a6b684a4d7
commit faccd9b2c3
2 changed files with 27 additions and 8 deletions

25
gen_tdp
View File

@ -5,21 +5,30 @@
# http://protocol.club/~datagrok/beta-wiki/tdp.html
#
# This command takes no arguments, and sends outputs to stdout.
# Version 1.0
# Version 1.1
#
# Licensed under a the AGPL 3.0 or later, by Ubergeek (ubergeek@thunix.net)
# https://www.gnu.org/licenses/gpl-3.0.en.html
#
###############################################################################
CONFIG=./setenv.sh
if [ ! -f "$CONFIG" ]; then
echo "Config file does not exist, or not at the location specified. Please create the file, or correct the location."
exit 1
fi
. $CONFIG
cat << _EOF
{
"name" : "thunix",
"url" : "https://thunix.net",
"want_users":true,
"admin_email": "root@thunix.net",
"signup_url": "https://www.thunix.net/signup",
"description": "Thunix is a community, centered around access to a public *nix system. Thunix offers shell accounts with complete set of programming tools, and follows a continuous integration-continuous deployment of system configuration.",
"name" : "$SITE_TITLE",
"url" : "$SITE",
"want_users":$WANT_USERS,
"admin_email": "$ADMIN_EMAIL",
"signup_url": "$SIGNUP_URL",
"description": "$DESCRIPTION",
_EOF
echo -ne "\t\"user_count\":"
@ -40,7 +49,7 @@ for i in $(for i in $(members tilde); do echo $i; done | sort | uniq); do
else
echo -e "\t\t\"mtime\" : \"$(stat -c '%Y' /home/$i/public_html/index.* 2> /dev/null | head -n1)\","
fi
echo -e "\t\t\"title\" : \""$(curl -L https://www.thunix.net/~$i -so - |grep -iPo '(?<=<title>)(.*)(?=</title>)')"\""
echo -e "\t\t\"title\" : \""$(curl -L $SITE/~$i -so - |grep -iPo '(?<=<title>)(.*)(?=</title>)')"\""
if [ $count -eq $(for i in $(members tilde); do echo $i; done | sort | uniq | wc -l) ]; then
echo -e "\t}"
else

10
setenv.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
# Here is where you set config variables.
export SITE_TITLE="Thunix"
export SITE="https://thunix.net"
export WANT_USERS="true"
export ADMIN_EMAIL="root@thunix.net"
export SIGNUP_URL="https://thunix.net/signup"
export DESCRIPTION="Thunix is a community, centered around access to a public *nix system. Thunix offers shell accounts with complete set of programming tools, and follows a continuous integration-continuous deployment of system configuration."