diff --git a/gen_tdp b/gen_tdp index 1ef0871..2ba809e 100755 --- a/gen_tdp +++ b/gen_tdp @@ -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 '(?<=