#!/bin/sh #The script by zhang hk. #DATE:2016-3-21 . /etc/init.d/functions PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/jdk/bin:/root/bin DesDir="webapps/ROOT/" DesFile="test.zip" if [ ! -d ../$DesDir ] ; then echo "$DesDir No such file or directory" exit 5 fi if [ ! -f ../${DesDir}${DesFile} ] ; then echo "$DesFile No such file or directory" exit 5 fi kill -9 $(cat ../*.pid) sleep 1s unzip -oq ../${DesDir}${DesFile} -d ../$DesDir [ $? -eq 0 ] || exit 1 ./startup.sh && tail -f ../logs/catalina.out