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

no.tsl2.nano.h5.2.5.6.source-code.restart-all.sh Maven / Gradle / Ivy

Go to download

TSL2 Framework Html5 Extensions (WebServer, Html5Presentation, RuleCover, BeanConfigurator, LogicTable-Sheet, Expression-Descriptors for Actions, Rules, URLs, Queries)

The newest version!
echo ======================================================
echo RESTARTING ALL TSL2NANO APPLICATIONS
echo Thomas Schneider / 08.2018
echo ======================================================

###########################################################
#    All NanoH5 Apps must be inside an own sub-directory
#    having the executable script 'runasservice.sh' 
###########################################################

# activate this block and de-activate that in your projects run.sh to admin the program-version centralized
export NAME=${project.artifactId}
export VERSION=${project.version}
#export EXTENSION="-standalone"
[[ "$1" == "localhost" ]] && export MYIP="localhost" && shift
export MYIP=${MYIP:-"$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p')"}
export OFFLINE="-Dtsl2nano.offline=true"
#export RESTART_ALL='-Dapp.login.secure=false -Dapp.login.administration=true -Dapp.login.jarfile.fileselector=false'
export TSL2_PROJECTS=${TSL2_PROJECTS:-$(ls -d */)}
if [[ $1 == "help" ]]; then
	echo "usage:=========================================================================="
	echo "clean    : removes all backup files (tar.gz and .sik) generated with this script"
	echo "stop     : doesn't restart but stops all services, started by this script"
	echo "help     : prints this help"
	echo "================================================================================"
	exit 0
fi
if [[ $1 == "clean" ]]; then
	echo "cleaning all tsl2nano backup files..."
	rm tsl2nano-all-services.tar.gz
	find . -type f -name '*.tar.gz' -or -name '*.sik' -exec rm -I {} +
fi
#echo "refreshing backup 'tsl2nano-all-services.tar.gz'..."
tar -uf --exclude *.gz --exclude=*.*ar --exclude *.log --exclude *.sik --exclude *.lck --exclude *.out --exclude target --exclude dist tsl2nano-all-services.tar.gz .

echo -e "RESTARTING TSL2_PROJECTS: \n$TSL2_PROJECTS\n"
echo "with MYIP:$MYIP"

html_body=$(cat <



    
    
    TSL2 Applications
    


	

TSL2 Applications

EOF ) echo "$html_body" > app-index.html for d in $TSL2_PROJECTS do if [[ -f $d"runasservice.sh" ]]; then cd $d ./runasservice.sh stop echo "" >> ../app-index.html sleep 2 mv nohup.out nohup.$(date -d "today" +"%Y%m%d%H%M").sik ./runasservice.sh backup if [[ $1 != "stop" ]]; then ./runasservice.sh start $@ "-Dapp.show.startpage=false" & echo "==> $d RESTARTED" fi cd .. else echo "==> $d has no runasservice.sh --> no nanoh5 directory" fi done echo "