-1
私は最近、Ubuntuにtomcat8をインストールしました。 /opt/tomcat/apache-tomcat-8.0.36/binにあり、./shutdown.shと./startup.shを手動で実行する必要があります。誰でも私に起動、シャットダウン、さらにはサーバの再起動ができるシェルスクリプトを教えてもらえますか?前もって感謝します。別のシェルスクリプトからシェルスクリプトを実行するには
私は最近、Ubuntuにtomcat8をインストールしました。 /opt/tomcat/apache-tomcat-8.0.36/binにあり、./shutdown.shと./startup.shを手動で実行する必要があります。誰でも私に起動、シャットダウン、さらにはサーバの再起動ができるシェルスクリプトを教えてもらえますか?前もって感謝します。別のシェルスクリプトからシェルスクリプトを実行するには
これはあなたが
#!/bin/bash
start() {
/opt/tomcat/apache-tomcat-8.0.36/bin/startup.sh
}
stop() {
/opt/tomcat/apache-tomcat-8.0.36/bin/shutdown.sh
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0
これを試してみてくださいhttp://stackoverflow.com/questions/192292/bash-how-best-to-include-other-scriptsを助けることができます – user3644708