Permalink
Browse files

more sophisticated install program

  • Loading branch information...
1 parent 200746a commit 3fe314cd7ee294f0e988296ed322c8a8de899478 BuzzTroll committed Sep 3, 2010
Showing with 24 additions and 7 deletions.
  1. +24 −7 lantorrent/install.sh
View
@@ -1,20 +1,37 @@
#!/bin/bash
-if [ "X$NIMBUS_HOME" == "X" ]; then
- echo "NIMBUS_HOME is not set."
- echo "This installation program is only used for the head node."
- echo "It is not used on the VMMs and it is typically only called from the main installer"
+if [ "X$1" == "X" ]; then
+ echo "please specify a target directory"
exit
fi
+installdir=$1
dir=`dirname $0`
cd $dir
LANTORRENT_HOME=`pwd`
-cp -r `pwd` $NIMBUS_HOME/
-cd $NIMBUS_HOME/lantorrent
+
+mkdir $installdir
+cp -r `pwd`/* $installdir
+rc=$?
+if [ $rc -ne 0 ]; then
+ echo "failed to copy over lantorrent"
+ exit $rc
+fi
+
+cd $installdir
+rc=$?
+if [ $rc -ne 0 ]; then
+ echo "could not change to the installation directory"
+ exit $rc
+fi
who=`whoami`
sed -e "s/@PORT@/2893/" -e "s/@SERVICENAME@/lantorrent/" -e "s/@WHO@/$who/" -e "s^@LANTORRENT_HOME@/$LANTORRENT_HOME/" etc/lantorrent.inet.in > lantorrent.inet
sqlite3 etc/req.db < etc/lt.sql
-exit $?
+rc=$?
+if [ $rc -ne 0 ]; then
+ echo "could not create the database"
+ exit $rc
+fi
+exit 0

0 comments on commit 3fe314c

Please sign in to comment.