您的位置:首页 > 运维架构 > Shell

我的工作脚本

2016-03-21 11:06 543 查看
#!/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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  shell