1、安装插件,AnsiColor
2、选择颜色日志输出
3、脚本编写
echo -e "\e[1;32m##################java start check #####################\e[0m"
b=`ssh -p X root@X.X.X.X "ssh root@X.X.X.X 'ps axu|grep -w XXX.jar|grep -v "grep"|wc -l'"`
if [ $b != "1" ]
then
echo -e "\e[1;34m Java start \e[1;31mFailed\e[0m,\e[1;34mPlease check for errors!\e[0m"
echo -e "\e[36m \t\t\t\t\t\t\t\t\t \e[0m"
echo -e "\e[36m \t\t\t\t\t\t\t\t\t \e[0m"
echo -e "\e[36m \t\t\t\t\t\t\t\t\t \e[0m"
echo -e "\e[1;31m###############################################\e[0m"
echo -e "\e[1;31m##### Please review the latest error logs #####\e[0m"
echo -e "\e[1;31m###############################################\e[0m"
s=`ssh -p X root@X.X.X.X "ssh root@X.X.X.X 'tail -100 /work/install/X/nohup.out'"`
echo "$s"
exit 1
else
echo -e "\e[1;34m Java start \e[1;31mSuccessful\e[0m"
fi
4.最后效果