#!/bin/sh
# http://www.berklix.com/~jhs/bin/.sh/gbde.sh
# Installed by http://berklix.com/~jhs/bin/.sh/Makefile to
#	/site/usr/local/bin/gbde.sh
# Called at end of /host/lap[hrs]/etc/rc.local
# (by which time AMD, which is needed, is running) as
#	/site/usr/local/bin/gbde.sh
# Can also be called manually as gbde.sh if eg:
#	- ethernet was not connected when booting,
#	- gbde missing from kernel & geom_bde_load="YES" from /boot/loader.conf
#	- or if /etc/rc.local has set a different
#	  domain as you are travelling, so that AMD fails,
#	  & you need to supply password yourself.

# JJLATER consider that if mount fails on lapr rc.local,
# & you go looking for gbde.sh, you wont find it, cos /site/usr/local/bin
# is not in search path.

# echo "Started gbde.sh"
if test -f /home/jhs/bin/.sh/gbde2.sh ; then
	echo "Copying /home/jhs/bin/.sh/gbde2.sh to keep up to date."
	cp /home/jhs/bin/.sh/gbde2.sh /site/usr/local/bin/gbde2.sh
else
	echo "No /home/jhs/bin/.sh/gbde2.sh to copy in."
fi
echo "Calling /site/usr/local/bin/gbde2.sh"
exec /site/usr/local/bin/gbde2.sh
# echo "Finished gbde.sh"
