• Java jar包启动脚本


    #!/bin/bash
    APP_HOME=/wdcloud/app/rps/rps-module-admin
    APP_JAR=rps-module-admin-*.jar
    APP_PIDS=$(ps ax | grep java | grep $APP_HOME | grep -v grep | awk '{print $1}')
    
    function start(){
    	if [ -z "$APP_PIDS" ]; then
    		echo "start project..."
    		exec java -jar $APP_HOME/$APP_JAR  >/dev/null 2>&1 &
    		echo "start project end..."
    	else
    		echo "warning: the spring boot server is started!!!====="$APP_HOME
    		exit 1
    	fi
    }
    
    function stop(){
    	if [ -z "$APP_PIDS" ]; then
    		echo "No spring boot server to stop"
    	else
    		echo "stop project..."
    		kill -s TERM $APP_PIDS
    		echo "stop project end..."
    	fi
    }
    
    
    function restart(){
        stop
        sleep 3
    	APP_PIDS=$(ps ax | grep java | grep $APP_HOME | grep -v grep | awk '{print $1}')
        start
    }
    
    case "$1" in
        start)  
        start
        ;;
        stop)
        stop
        ;;
        restart)
        restart
        ;;
        *)  
        printf 'Usage: %s {start|stop|restart}
    ' "$prog"
        ;;
    esac
    exit 1
    
    
  • 相关阅读:
    Git引用
    如何查看Git对象
    Git是如何存储对象的
    图形化的Git
    git中找回丢失的对象
    Git的Patch功能
    ES查看配置和查看全部配置
    增删改查
    Elasticsearch增、删、改、查操作深入详解
    ES博客链接
  • 原文地址:https://www.cnblogs.com/zhucww/p/10751500.html
Copyright © 2020-2023  润新知