123456789101112131415161718192021222324252627282930313233343536373839404142 |
- DIRECTORY=`dirname $0`
- echo $DIRECTORY
- INIFILEDIR=$1
- HOMEDIR=$DIRECTORY
- cd $DIRECTORY
- if [ "$HOMEDIR" == "" ] ; then
- HOME=$(pwd)
- else
- HOME=$HOMEDIR
- fi
- LOG=$INIFILEDIR/logs
- LOGFILE=$INIFILEDIR/logs/log.txt
- EXEFILE=$HOME/fss
- pid="pid"
- if [ "$INIFILEDIR" == "" ] ; then
- echo "Error:no data directory"
- exit 0
- fi
- if [ ! -d $INIFILEDIR ] ; then
- echo "Error:invalid data directory"
- exit 0
- else
- OPTION="-fss-config=$INIFILEDIR"
- fi
- if [ ! -d $LOG ] ; then
- mkdir $LOG
- fi
-
- if [ -f $HOME/$pid ] ; then
- echo "pid file exists. unable to start."
- else
- $EXEFILE $OPTION >> $LOGFILE 2>&1 &
- echo $!>$HOME/pid
- echo "started"
- fi
|