Linux Deployment scripts

Source: Internet
Author: User

Shell Script

#!/bin/bash# setting up the JDK environment export Java_home=/usr/java/jdk1.8.0_45export jre_home= $JAVA _home/jreexport classpath=.: $JAVA _ Home/lib: $JRE _home/lib: $CLASSPATHexport path= $JAVA _home/bin: $JRE _home/bin: $PATH ################################ # # # #环境变量及程序执行参数 # You need to modify these parameters according to the actual environment and the Java program name ################################### #需要启动的Java主程序 (Main method Class) jar_file= " Schedule.server-1.0-snapshot.jar "#项目路径APP_HOME ="/home/robin/wallet_push "#环境配置ENV_OPTS ="-- Spring.profiles.active=release "spring_config_location="--spring.config.location= $APP _home/release/ Job.properties, $APP _home/release/application.properties, $APP _home/release/quartz.properties "#端口号SERVER_PORT =" 8085 "#java虚拟机启动参数JAVA_OPTS ="-ms512m-mx512m-xmn256m-djava.awt.headless=true-xx:maxpermsize=128m- Dsun.net.http.allowrestrictedheaders=true "#################################### get Process Idpid=0checkpid () {Server_pid =$ (pgrep-f $JAR _file) If [-N ' $server _pid "]; Then pid= ' echo $server _pid ' else pid=0 Fi}start () {echo "Ready to start $JAR _file" chEckpid if [0-ne $pid] then echo "Warn:server started already!"            else Java $JAVA _ops-jar $JAR _file--server.port= $SERVER _port $SPRING _config_location > Stdout.log &                Sleep 3s if [0-ne $pid] then echo "warining:failed" Else echo "Server Started" fi fi}stop () {checkpid if [0-ne $pid] then kill-                9 $pid checkpid If [0-eq $pid] then echo "Server stoped" Else            echo "Warning:server toped failed!"        Fi else echo ' warning:server not started! '     Fi}case $ in start) start;    restart) stop start;; stop) stop;; Esac

Linux Deployment Scripts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.