Difference between revisions of "Gwd-start"

From GeneWeb
Jump to: navigation, search
Line 98: Line 98:
 
   echo "Starting update_nldb ..."
 
   echo "Starting update_nldb ..."
 
fi
 
fi
echo "Base $DEFAULTBASE"
+
# you may want to insert here appropriate lines according to your existing bases
./update_nldb $BASE_DIR/$DEFAULTBASE.gwb
+
#echo "Base $DEFAULTBASE"
 +
#./update_nldb $BASE_DIR/$DEFAULTBASE.gwb
 
# find a way to minimise window
 
# find a way to minimise window
  

Revision as of 15:20, 14 October 2015

#!/bin/sh

# Directory where to store GeneWeb base
BASE_DIR="$HOME/Genealogy/GeneWeb-Bases"

# Directory where to store GeneWeb distributions 
VERS="GeneWeb-7.00-Mac"
BIN_DIR="$HOME/Genealogy/GeneWeb"

rm -f $BIN_DIR/*.gwdversion
touch $BIN_DIR/$VERS.gwdversion

# Name of the base to open at start-up
DEFAULTBASE="HenriT"
# Language to use (de/en/es/fr/it/lv/sv) 
# if not in the list will be en
LANG=fr

##########
# Do not modify the following lines

# Shutdown daemon already running
killall gwd
killall gwsetup
killall gwstp

# Verify language
case "$LANG" in
  de*) LANG=de;;
  es*) LANG=es;;
  fr*) LANG=fr;;
  it*) LANG=it;;
  lv*) LANG=lv;;
  sv*) LANG=sv;;
  *) LANG=en;;
esac
DIR="$(dirname "$0")"
cd "$DIR"
export LANG

pids=""
trap 'kill $pids' 1 2
echo "Testing Bin Dir"
if [ -d $BIN_DIR ]; then
	echo "Bin Dir OK"
else
	echo
	if test "$LANG" = "fr"; then
 		echo "BIN_DIR n'existe pas"
	else
  		echo "BIN_DIR does not exist"
	fi
  	exit
fi

echo "Testing Base Dir"
if [ -d $BASE_DIR ]; then
	echo "Base Dir OK"
else
	echo
	if test "$LANG" = "fr"; then
 		echo "BASE_DIR n'existe pas"
	else
  		echo "BASE_DIR does not exist"
	fi
  	exit
fi

cd "$BASE_DIR"

if [ -f gwd.log ]; then
  mv gwd.log gwd.log.old
fi

# Starting gwsetup
if test "$LANG" = "fr"; then
  echo "Demarrage de gwsetup..."
else
  echo Starting gwsetup...
fi
"$BIN_DIR/$VERS/gw/gwsetup" -gd "$BIN_DIR/$VERS/gw" -bindir "$BIN_DIR/$VERS/gw" -lang $LANG > gwsetup.log 2>&1 &

# Starting gwd
if test "$LANG" = "fr"; then
  echo "Demarrage de gwd..."
else
  echo "Starting gwd..."
fi
cd "$BIN_DIR/$VERS/gw"
"./gwd" -allowed_tags ./tags.txt -hd "./gw" -bd "$BASE_DIR" -robot_xcl 1000,1 > gwd.log 2>&1 &
pids="$pids $!"

# Updating nldb
if test "$LANG" = "fr"; then
  echo "Demarrage de update_nldb ..."
else
  echo "Starting update_nldb ..."
fi
# you may want to insert here appropriate lines according to your existing bases
#echo "Base $DEFAULTBASE"
#./update_nldb $BASE_DIR/$DEFAULTBASE.gwb
# find a way to minimise window

echo "step 3"
if test "$LANG" = "fr"; then
  echo "Gardez cette fenêtre ouverte tant que"
  echo "vous voulez utiliser GeneWeb dans votre"
  echo "navigateur"
else
  echo "Keep this window open while you"
  echo "are using GeneWeb on your browser"
fi

sleep 2

# Open the starting page
open "$BIN_DIR/$VERS/START.htm"