From d1949464e2b34d8dc80734afcc4306c0139e3f7a Mon Sep 17 00:00:00 2001 From: Tom Wiesing Date: Wed, 7 Oct 2020 13:26:18 +0200 Subject: [PATCH] Add info.sh script --- distillery/info.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 distillery/info.sh diff --git a/distillery/info.sh b/distillery/info.sh new file mode 100755 index 0000000..b4bd6ee --- /dev/null +++ b/distillery/info.sh @@ -0,0 +1,38 @@ +#!/bin/bash +set -e + +# read the lib/shared.sh and read the slug argument. +DISABLE_LOG=1 +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +cd "$DIR" +source "$DIR/lib/lib.sh" +DISABLE_LOG=0 +require_slug_argument + + +# if the site doesn't exist, I can't open a shell. +if ! sql_bookkeep_exists "$SLUG"; then + log_error "=> Site '$SLUG' does not exist in bookeeping table. " + echo "I can't show info about it. " + exit 1 +fi; + +# Read everything from the database +read -r INSTANCE_BASE_DIR MYSQL_DATABASE MYSQL_USER GRAPHDB_REPO GRAPHDB_USER GRAPHDB_PASSWORD <<< "$(sql_bookkeep_load "${SLUG}" "filesystem_base,sql_database,sql_user,graphdb_repository,graphdb_user,graphdb_password" | tail -n +2)" + +GRAPHDB_HEADER="$(echo "$GRAPHDB_USER:$GRAPHDB_PASSWORD" | base64)" + + +echo "==================================================================================" +echo "URL: http://$INSTANCE_DOMAIN" +echo "Base directory: ${INSTANCE_BASE_DIR}" +log_info " => Your GraphDB details (for WissKI Salz) are: " +echo "Read URL: http://triplestore:7200/repositories/$GRAPHDB_REPO" +echo "Write URL: http://triplestore:7200/repositories/$GRAPHDB_REPO/statements" +echo "Username: $GRAPHDB_USER" +echo "Password: $GRAPHDB_PASSWORD" +echo "Authorization Header: $GRAPHDB_HEADER" +echo "Writable: yes" +echo "Default Graph URI: http://$INSTANCE_DOMAIN/#" +echo "Ontology Paths: (empty)" +echo "SameAs property: http://www.w3.org/2002/07/owl#sameAs" \ No newline at end of file