All Downloads are FREE. Search and download functionalities are using the official Maven repository.

no.tsl2.nano.h5.2.5.3.source-code.runasservice.sh Maven / Gradle / Ivy

#!/bin/bash
# start script for tsl2nano as service

APPNAME=environment
PORT=8067
APPDIR=.nanoh5.$APPNAME
if [ "$1" == "--help" ]
	then
	echo "usage: $0 [stop | backup | --help]"
	echo "  if no parameter was given, this application starts"
	echo "  with environment $APPDIR"
	echo ""
	echo "  stop  : stops the process $APPNAME, if running already"
	echo "  backup: creatings a compressed tar backup file"
	echo "  --help: prints the help screen and exits"
	exit 0
fi
if [ "$1" == "backup" ]
	then
	ARCHIVE_NAME=backup-${PWD##*/}-$(date -d "today" +"%Y%m%d%H%M").tar.gz
	echo "creating backup $ARCHIVE_NAME ..."
	tar -czf $ARCHIVE_NAME *.sh $APPDIR .nanoh5.* --exclude=*.*ar --exclude=*.zip --exclude=temp --exclude=*.log --exclude=*.lck --exclude=target --exclude=dist
	exit 0
fi
if [ "$1" == "stop" ]
	then
	APPID=$(ps -C java -o pid= -o command= | grep $APPNAME | grep -o -E "^[0-9]+" | line)
	if [ "$APPID" == "" ]
		then
		echo "$APPNAME is not running yet..."
		exit 1
	fi
	kill -9 $APPID
	echo "$APPNAME stopped successfully"
	exit 0
fi
nohup ./run.sh $APPDIR $PORT &Z 
# < /dev/null & tail -F $APPDIR/logfactory.log





© 2015 - 2025 Weber Informatics LLC | Privacy Policy