LINUX下用脚本实现JDK TOMCAT
这几天真是累.常常下半夜3点睡觉.是这段时间对LINUX下的SHELL编程喜欢上了.
touch /home/aaaaa jk="/home/aaaaa" echo "#!/bin/bash
" >$jk chmod a x $jk cd /home ./aaaaa echo "select ''N'' is withdraws from ; echo -n "select Y or N:"
if [ "$NAME" == "N" ]
echo "select ''N'' is exit" else find / -name jakarta-tomcat-5.0.28.tar.gz > /aaa
mkdir /opt/tomcat find / -name jakarta-tomcat-5.0.28 > /la
cp `cat /aaa` / ./j2sdk-1.4.2-03-linux-i586.bin rm -rf /aaa cp -r /j2sdk1.4.2/* /usr/jdk
rm -rf /j2sdk1.4.2 /j2sdk-1.4.2-03-linux-i586.bin mv /etc/profile /etc/zuan sed ''s/export/& JAVA_HOME CLASS_PASS TOMCAT_HOME /'' /etc/zuan>/etc/yirehe sed ''/local/a pathmunge /usr/jdk/bin'' /etc/yirehe>/etc/ewang sed ''/LOGNAME=$USER/aCLASS_PATH="/usr/jdk/lib/tools.jar" JAVA_HOME="/usr/jdk/" TOMCAT_HOME="/opt/tomcat/"'' /etc/ewang>/etc/profile rm -rf /etc/zuan /etc/yirehe /etc/ewang mv /opt/tomcat/conf/tomcat-users.xml /opt/tomcat/conf/bdyd sed ''7d'' /opt/tomcat/conf/bdyd>/opt/tomcat/conf/yileng sed ''9d'' /opt/tomcat/conf/yileng>/opt/tomcat/conf/bdyda echo "<user name="aaa" password="aaa" roles="yirehe" />" >> /opt/tomcat/conf/bdyda echo "</tomcat-users>" >> /opt/tomcat/conf/bdyda sed ''s/aaa/"admin"/g'' /opt/tomcat/conf/bdyda> /opt/tomcat/conf/kaka sed ''s/yirehe/"admin,manager"/g'' /opt/tomcat/conf/kaka> /opt/tomcat/conf/tomcat-users.xml rm -rf /opt/tomcat/conf/bdyd /opt/tomcat/conf/yileng /opt/tomcat/conf/bdyda /opt/tomcat/conf/kaka
sed ''s/Connector port="8080"/Connector port="80"/'' /opt/tomcat/conf/aaa>/opt/tomcat/conf/djdk sed ''s/Connector port="8443"/Connector port="443"/'' /opt/tomcat/conf/djdk>/opt/tomcat/conf/server.xml rm -rf /opt/tomcat/conf/djdk /opt/tomcat/conf/aaa mv /opt/tomcat/conf/server.xml /opt/tomcat/conf/aaa sed ''s/Connector port="8080"/Connector port="80"/'' /opt/tomcat/conf/aaa>/opt/tomcat/conf/djdk sed ''s/Connector port="8443"/Connector port="443"/'' /opt/tomcat/conf/dj |
|
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |