#!/bin/sh
# http://www.berklix.net/~jhs/src/bsd/jhs/bin/public/xearth1/xearth1.sh
# by jhs @ berklix.net
# See Also ../xearth4
# xearth4 was written years before xearth1, the numbers refer to images,
#       not some version number

# Coyright Julian H. Stacey 2017-09-10

# Purpose:
#	Returns return a single up to date xearth graphic image 
#	It may be called from eg http://www.berklix.com/~jhs/
#	which is fed by 2 servers, from one of various virtual domain sub dirs,
#	but must only return an up to date image, not obsolete old images.
#	-
#	For now I force it to a single server for the graphics image.
#	JJLATER it would be nice to have a sub shell, 
#	(& an asserted variable to avoid recursion)
#	so that even if prme server fails, the other server will take over.
#	-
#	To help phone callers decide if the other person may be asleep.
#	As well as the acceptable clueless, I have had agressive bastards
#	phoning from Quebec and California to Germany who refused to keep
#	it short and non demanding, even when told it is 2 to 3 AM in middle
#	of night in Europe.
# Always run 'make check; after editing !

# This script is installed to /usr/local/www/cgi-bin/xearth1
# Called by http://www.berklix.net/cgi-bin/xearth1

# Used by all of
#	/home/jhs/public_html/deter/index.lmth
#	/home/jhs/public_html/index.lmth
#	/home/jhs/public_html/mail/index.lmth
#	/home/jhs/public_html/phone/index.lmth
#	/site/usr/local/www/Data/virtual/berklix.com/index.lmth
#	/site/usr/local/www/Data/virtual/berklix.de/index.lmth
#	/site/usr/local/www/Data/virtual/berklix.eu/index.lmth
#	/site/usr/local/www/Data/virtual/berklix.net/index.lmth
#	/site/usr/local/www/Data/virtual/berklix.org/index.lmth
#	/site/usr/local/www/Data/virtual/berklix.uk/index.lmth
#	/site/usr/local/www/Data/virtual/bsdpie.eu/index.lmth

PATH=/sbin:/bin:/usr/sbin:/usr/bin

# TZ=Europe/Berlin # Inherited

export HOME PATH TZ

echo 'Content-Type: image/gif ; name="xearth_orthographic_day.gif"'
echo
/usr/local/bin/xearth -gif -nostars -size 128,128 -proj orthographic 
exit 0
