From 189da2c79ce6c6ff4fe5270fe0b3ecde4e451518 Mon Sep 17 00:00:00 2001 From: DanielsLPecke Date: Thu, 10 Nov 2016 14:11:32 +0100 Subject: New feature: support hostname-faking --- bin/impressive-display | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/impressive-display b/bin/impressive-display index 32ad061..e4ede36 100755 --- a/bin/impressive-display +++ b/bin/impressive-display @@ -40,6 +40,7 @@ PDF_URL="http://localhost" WITH_PULSEAUDIO="yes" HIDE_IDLE_POINTER="yes" + # There can be master terminals and slave display. # All terminal not listed here are slave displays... PRIMARY_DISPLAYS="$(hostname -f)" @@ -151,8 +152,14 @@ PDF_URL_CREDS="$PDF_URL_SECONDARIES_CREDS" PDF_FILE="$PDF_FILE_SECONDARIES" RESOLUTION="$SECONDARIES_RESOLUTION" +# if FAKE_HOSTNAME is not empty, use that string for hostname +THIS_HOSTNAME=$(hostname -f) +if [ -n "$FAKE_HOSTNAME" ]; then + THIS_HOSTNAME="$FAKE_HOSTNAME" +fi + for primary_display in $PRIMARY_DISPLAYS; do - if [ "x$(hostname -f)" = "x$primary_display" ]; then + if [ "x$THIS_HOSTNAME" = "x$primary_display" ]; then PDF_URL="$PDF_URL_PRIMARIES" PDF_URL_CREDS="$PDF_URL_PRIMARIES_CREDS" PDF_FILE="$PDF_FILE_PRIMARIES" @@ -444,6 +451,7 @@ function create_lock { ### MAIN ### $OUTPUT "INFO: IMPRESSIVE Display (version $VERSION)" +$OUTPUT "INFO: HOSTNAME set to: $THIS_HOSTNAME" if [ -n "$PDF_URL" ]; then -- cgit v1.2.3