summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanielsLPecke <daniel.letsplay007@gmail.com>2016-11-10 14:11:32 +0100
committerDanielsLPecke <daniel.letsplay007@gmail.com>2016-11-10 14:11:32 +0100
commit189da2c79ce6c6ff4fe5270fe0b3ecde4e451518 (patch)
tree349c67739257021825d2be404793780477b081b2
parent98f14193a9fbdbfb8db581803c84316602b4687e (diff)
downloadimpressive-display-189da2c79ce6c6ff4fe5270fe0b3ecde4e451518.tar.gz
impressive-display-189da2c79ce6c6ff4fe5270fe0b3ecde4e451518.tar.bz2
impressive-display-189da2c79ce6c6ff4fe5270fe0b3ecde4e451518.zip
New feature: support hostname-faking
-rwxr-xr-xbin/impressive-display10
1 files changed, 9 insertions, 1 deletions
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