晨必须的 发表于 2013-1-31 10:22:12

shell 脚本 实例代码

一、重启tomcat
 
 
#!/bin/sh
restart() {
tomcat6_dir=$1
bash $tomcat6_dir/shutdown.sh
if [ $? != 0 ]; then
exit 0
else
sleep 2
bash $tomcat6_dir/startup.sh
fi
}
 
tomcat6_dir=/home/user/tomcat6/bin
 
restart $tomcat6_dir
 
exit 0
页: [1]
查看完整版本: shell 脚本 实例代码