#!/bin/bash source /etc/profile str=$"\n" kill -9 $(sudo netstat -nlp | awk -F'[ /]*' '/8762/{print $(NF-2)}') cp /home/wifilock/intelligent-family.jar /apps/intelligent-family nohup java -jar intelligent-family.jar --spring.profiles.active=test -1 8 8 >/dev/null 1>intelligent-family.log & sstr=$(echo -e $str) echo $sstr tail -20 intelligent-family.log
說明:java
jenkins部署時錯誤:
意思是:由於你是從一個非tty環境執行腳本;Jenkins不能正常從你的腳本中退出。 解決辦法: