tomcat设置一键重启的restar.sh文件
在tomcat的bin目录下天机restar.sh文件内容如下:
#!/bin/bash
script_name=${0##*/}
script_path=${0%/*}
s_curren_dir=$(pwd)
exec $script_path/tomcat.server restart
exit $?
在tomcat的bin目录下添加tomcat.server文件内容如下:
#!/bin/bash
script_name=${0##*/}
script_path=${0%/*}
script_path=`cd "$script_path" ; pwd`
s_curren_dir=$(pwd)
#[conf]
tomcat_bin=$script_path/"catalina.sh"
action="$1"
#absolute_path=$(echo $script_path | awk -F"/" '{print$1}')
#echo $abc
#if [ -n "$absolute_path" ]; then
# echo "must use absolute path run script!"
# exit 100
#fi
[ -f $tomcat_bin ] || {
echo "tomacat catalina.sh is not exists."
echo "error!"
exit 2
}
success_msg() {
echo -ne "\033[60G[\033[0;32m OK &nb
script_name=${0##*/}
script_path=${0%/*}
script_path=`cd "$script_path" ; pwd`
s_curren_dir=$(pwd)
#[conf]
tomcat_bin=$script_path/"catalina.sh"
action="$1"
#absolute_path=$(echo $script_path | awk -F"/" '{print$1}')
#echo $abc
#if [ -n "$absolute_path" ]; then
# echo "must use absolute path run script!"
# exit 100
#fi
[ -f $tomcat_bin ] || {
echo "tomacat catalina.sh is not exists."
echo "error!"
exit 2
}
success_msg() {
echo -ne "\033[60G[\033[0;32m OK &nb