Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
* added long options and help-option to linux startscript * redirect all error messages to /dev/null
f1ori04310a7255aa
diff --git a/startYACY.sh b/startYACY.shindex b6c8cd7de..c4291d716 100755--- a/startYACY.sh+++ b/startYACY.sh@@ -31,10 +31,22 @@ thenexit 1fi+usage() {+ cat - <<USAGE+startscript for YaCy on UNIX-like systems+Options+ -h, --help show this help+ -t, --tail-log show the output of "tail -f DATA/LOG/yacy00.log" after starting YaCy+ -l, --logging save the output of YaCy to yacy.log+ -d, --debug show the output of YaCy on the console+ -p, --print-out only print the command, which would be executed to start YaCy+USAGE+}+#startup YaCycd "`dirname $0`"-options="`getopt -n YaCy -o d,l,p,t -- $@`"+options="`getopt -n YaCy -o h,d,l,p,t -l help,debug,logging,print-out,tail-log -- $@`"if [ $? -ne 0 ];thenexit 1;fi@@ -48,23 +60,32 @@ PRINTONLY=0TAILLOG=0for option in $options;doif [ $isparameter -ne 1 ];then #option- if [ "$option" = "-l" ];then- LOGGING=1- if [ $DEBUG -eq 1 ];then- echo "can not combine -l and -d"- exit 1;- fi- elif [ "$option" = "-d" ];then- DEBUG=1- if [ $LOGGING -eq 1 ];then- echo "can not combine -l and -d"- exit 1;- fi- elif [ "$option" = "-p" ];then- PRINTONLY=1- elif [ "$option" = "-t" ];then- TAILLOG=1- fi #which option+ case $option in+ -h|--help)+ usage+ exit 3+ ;;+ -l|--logging)+ LOGGING=1+ if [ $DEBUG -eq 1 ];then+ echo "can not combine -l and -d"+ exit 1;+ fi+ ;;+ -d|--debug)+ DEBUG=1+ if [ $LOGGING -eq 1 ];then+ echo "can not combine -l and -d"+ exit 1;+ fi+ ;;+ -p|--print-out)+ PRINTONLY=1+ ;;+ -t|--tail-log)+ TAILLOG=1+ ;;+ esac #case optionelse #parameterif [ x$option = "--" ];then #option / parameter seperatorisparameter=1;@@ -154,7 +175,7 @@ thenelif [ $LOGGING -eq 1 ];then #loggingcmdline="$cmdline >> yacy.log & echo \$! > $PIDFILE"else- cmdline="$cmdline >> /dev/null & echo \$! > $PIDFILE"+ cmdline="$cmdline &> /dev/null & echo \$! > $PIDFILE"fiif [ $PRINTONLY -eq 1 ];thenecho $cmdline@@ -169,6 +190,7 @@ elseecho " >> YaCy started as daemon process. Administration at http://localhost:$PORT << "eval $cmdlineif [ "$TAILLOG" -eq "1" -a ! "$DEBUG" -eq "1" ];then+ sleep 1tail -f DATA/LOG/yacy00.logfifi