删除多余文件
This commit is contained in:
parent
a94982db84
commit
3d633dc032
115
bin/wvp.sh
115
bin/wvp.sh
|
|
@ -1,115 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
function log() {
|
||||
message="[Polaris Log]: $1 "
|
||||
case "$1" in
|
||||
*"Fail"* | *"Error"* | *"请使用 root 或 sudo 权限运行此脚本"*)
|
||||
echo -e "${RED}${message}${NC}" 2>&1 | tee -a
|
||||
;;
|
||||
*"Success"*)
|
||||
echo -e "${GREEN}${message}${NC}" 2>&1 | tee -a
|
||||
;;
|
||||
*"Ignore"* | *"Jump"*)
|
||||
echo -e "${YELLOW}${message}${NC}" 2>&1 | tee -a
|
||||
;;
|
||||
*)
|
||||
echo -e "${BLUE}${message}${NC}" 2>&1 | tee -a
|
||||
;;
|
||||
esac
|
||||
}
|
||||
echo
|
||||
cat <<EOF
|
||||
██████╗ ██████╗ ██╗ █████╗ ██████╗ ██╗███████╗
|
||||
██╔══██╗██╔═══██╗██║ ██╔══██╗██╔══██╗██║██╔════╝
|
||||
██████╔╝██║ ██║██║ ███████║██████╔╝██║███████╗
|
||||
██╔═══╝ ██║ ██║██║ ██╔══██║██╔══██╗██║╚════██║
|
||||
██║ ╚██████╔╝███████╗██║ ██║██║ ██║██║███████║
|
||||
╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚══════╝
|
||||
|
||||
EOF
|
||||
|
||||
#配置jdk的路径
|
||||
export JAVA_HOME=/usr/local/java/jdk1.8.0_202 #此处为JDK路径
|
||||
export JRE_HOME=${JAVA_HOME}/jre
|
||||
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
|
||||
export PATH=${JAVA_HOME}/bin:$PATH
|
||||
|
||||
# WVP-pro defines
|
||||
AppName=wvp-pro-2.7.2-05131055.jar
|
||||
AppHome="/root/polaris/wvp/"
|
||||
# JVM参数
|
||||
JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512m -Xmx2048m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
|
||||
|
||||
function start() {
|
||||
log "======================= 开启流媒体服务 ======================="
|
||||
log "AppName: $AppName"
|
||||
log "AppHome: $AppHome"
|
||||
log "Success:流媒体服务开启成功"
|
||||
}
|
||||
|
||||
function stop() {
|
||||
log "======================= 停止流媒体服务 ======================="
|
||||
|
||||
PID=""
|
||||
query() {
|
||||
PID=$(ps -ef | grep java | grep $AppName | grep -v grep | awk '{print $2}')
|
||||
}
|
||||
query
|
||||
if [ x"$PID" != x"" ]; then
|
||||
log "进程PID: $PID"
|
||||
kill -TERM $PID
|
||||
log "$AppName (pid:$PID) exiting..."
|
||||
while [ x"$PID" != x"" ]; do
|
||||
sleep 1
|
||||
query
|
||||
done
|
||||
log "Success:$AppName exited."
|
||||
else
|
||||
log "Jump:进程不存在"
|
||||
fi
|
||||
}
|
||||
|
||||
function status() {
|
||||
log "======================= 运行状态 ======================="
|
||||
log ""
|
||||
|
||||
PID=$(ps -ef | grep java | grep $AppName | grep -v grep | wc -l)
|
||||
if [ $PID != 0 ]; then
|
||||
log "进程PID: $PID"
|
||||
log "$AppName is running..."
|
||||
else
|
||||
log "$AppName is not running..."
|
||||
fi
|
||||
log ""
|
||||
log "========================================================"
|
||||
}
|
||||
|
||||
function restart() {
|
||||
stop
|
||||
sleep 3
|
||||
start
|
||||
}
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
status)
|
||||
status
|
||||
;;
|
||||
*) ;;
|
||||
|
||||
esac
|
||||
|
||||
91
bootstrap.sh
91
bootstrap.sh
|
|
@ -1,91 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
######################################################
|
||||
# Copyright 2019 Pham Ngoc Hoai
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# Repo: https://github.com/tyrion9/spring-boot-startup-script
|
||||
#
|
||||
######### PARAM ######################################
|
||||
|
||||
JAVA_OPT=-Xmx1024m
|
||||
JARFILE=`ls -1r *.jar 2>/dev/null | head -n 1`
|
||||
PID_FILE=pid.file
|
||||
RUNNING=N
|
||||
PWD=`pwd`
|
||||
|
||||
######### DO NOT MODIFY ########
|
||||
|
||||
if [ -f $PID_FILE ]; then
|
||||
PID=`cat $PID_FILE`
|
||||
if [ ! -z "$PID" ] && kill -0 $PID 2>/dev/null; then
|
||||
RUNNING=Y
|
||||
fi
|
||||
fi
|
||||
|
||||
start()
|
||||
{
|
||||
if [ $RUNNING == "Y" ]; then
|
||||
echo "Application already started"
|
||||
else
|
||||
if [ -z "$JARFILE" ]
|
||||
then
|
||||
echo "ERROR: jar file not found"
|
||||
else
|
||||
nohup java $JAVA_OPT -Djava.security.egd=file:/dev/./urandom -jar $PWD/$JARFILE > nohup.out 2>&1 &
|
||||
echo $! > $PID_FILE
|
||||
echo "Application $JARFILE starting..."
|
||||
tail -f nohup.out
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
if [ $RUNNING == "Y" ]; then
|
||||
kill -9 $PID
|
||||
rm -f $PID_FILE
|
||||
echo "Application stopped"
|
||||
else
|
||||
echo "Application not running"
|
||||
fi
|
||||
}
|
||||
|
||||
restart()
|
||||
{
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
|
||||
'start')
|
||||
start
|
||||
;;
|
||||
|
||||
'stop')
|
||||
stop
|
||||
;;
|
||||
|
||||
'restart')
|
||||
restart
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 { start | stop | restart }"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# 获取当前日期并格式化为 YYYY-MM-DD 的形式
|
||||
current_date=$(date +"%Y-%m-%d")
|
||||
|
||||
mkdir -p "$current_date"/数据库
|
||||
|
||||
cp -r ./数据库/2.7.3 "$current_date"/数据库
|
||||
|
||||
cp src/main/resources/配置详情.yml "$current_date"
|
||||
cp src/main/resources/application-dev.yml "$current_date"/application.yml
|
||||
|
||||
cp ./target/wvp-pro-*.jar "$current_date"
|
||||
|
||||
zip -r "$current_date".zip "$current_date"
|
||||
|
||||
rm -rf "$current_date"
|
||||
|
||||
exit 0
|
||||
|
||||
Loading…
Reference in New Issue