-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: misc
action: commit
revision:
path_from:
revision_from: a23b5f921d551863dbcae494e58622164a1d3492:
path_to:
revision_to:

git.thebackupbox.net

misc

git://git.thebackupbox.net/misc

commit a23b5f921d551863dbcae494e58622164a1d3492
Author: Epoch Qwert <epoch@53flpnlls43fcguy.onion>
Date:   Thu Oct 23 01:54:42 2014 -0500

    added some nifty magic for hostname instead of using one given on command-line

diff --git a/nocompile/libexec/gopherd.sh b/nocompile/libexec/gopherd.sh

index 6d12cd6ee638c06aace7310a6f7fb557549ae78f..

index ..e50b1294b377002880c68dde2eff29006ac39b0b 100755

--- a/nocompile/libexec/gopherd.sh
+++ b/nocompile/libexec/gopherd.sh
@@ -9,7 +9,16 @@ if grep -v "^${base}" <<< "${realpath}" > /dev/null;then
  echo ${realpath}
  exit 1
 fi
-hostname=$(/usr/local/bin/hop0 $(/usr/local/libexec/peerip))
+myIP=$(/usr/local/bin/hop0 $(/usr/local/libexec/peerip))
+hostname=$(dig -x ${myIP} +short | rev | tail -c+2 | rev )
+if [ ! "${hostname}" ]; then
+ hostname=${myIP}
+else
+ if [ $(dig +short $hostname) != ${myIP} ];then
+  logger "hostname (${hostname}) and IP (${myIP}) aren't matching up. >_>";
+  exit 2
+ fi
+fi
 type=$(file "${realpath}" | cut -d: -f2-)
 if grep directory <<< "$type" 2>&1 > /dev/null; then
  if [ -e "${realpath}/.header" ];then

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 16:06:11 2024