Difference between revisions of "Gwd-start"

From GeneWeb
Jump to: navigation, search
(gwd/gwsetup start script)
 
m
Line 3: Line 3:
  
 
# Directory where to store GeneWeb base
 
# Directory where to store GeneWeb base
BASE_DIR="$HOME/Genea/GeneWeb-Bases"
+
BASE_DIR="$HOME/Genealogy/GeneWeb-Bases"
  
 
# Directory where to store GeneWeb distributions  
 
# Directory where to store GeneWeb distributions  
 
VERS="GeneWeb-7.00-Mac"
 
VERS="GeneWeb-7.00-Mac"
BIN_DIR="$HOME/Genea/GeneWeb"
+
BIN_DIR="$HOME/Genealogy/GeneWeb"
  
 
rm -f $BIN_DIR/*.gwdversion
 
rm -f $BIN_DIR/*.gwdversion
Line 21: Line 21:
 
# Do not modify the following lines
 
# Do not modify the following lines
  
# Shutdown daemon allready running
+
# Shutdown daemon already running
 
killall gwd
 
killall gwd
 
killall gwsetup
 
killall gwsetup

Revision as of 14:41, 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
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 setting pages and the default base
open "http://localhost:2317/$DEFAULTBASE"