diff --git a/etc/writedb_entry b/etc/writedb_entry
index fd67a336f7a8516a34cbc4b7e9891a69a46ac5cf..060daff5076b0bedd4ffb24b4a20fe7d5f178c08 100755
--- a/etc/writedb_entry
+++ b/etc/writedb_entry
@@ -8,8 +8,20 @@
 
 args="$*"
 
-ARTEMIS_HOME=/software/pathogen/projects/artemis/current/
-ARTEMIS_HOME=/software/pathogen/projects/artemis/test/
+PRG=$0
+progname=`basename $0`
+
+while [ -h "$PRG" ] ; do
+  ls=`ls -ld "$PRG"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '.*/.*' > /dev/null; then
+      PRG="$link"
+  else
+      PRG="`dirname $PRG`/$link"
+  fi
+done
+
+ARTEMIS_HOME=`dirname "$PRG"`/..
 
 CLASSPATH=$ARTEMIS_HOME:$ARTEMIS_HOME/lib/biojava.jar:$ARTEMIS_HOME/lib/jemAlign.jar:$ARTEMIS_HOME/lib/jakarta-regexp-1.2.jar:$ARTEMIS_HOME/lib/macos.jar:$ARTEMIS_HOME/lib/postgresql-8.1-407.jdbc2ee.jar:$ARTEMIS_HOME/lib/chado-14-interface.jar:$CLASSPATH