Shell脚本自动部署Java环境

#!/bin/bash

if [ ! -d /home/tools/ ];then
mkdir -p /home/tools
else
rm -rf /home/tools && mkdir -p /home/tools
fi

cd /home/tools && wget http://download.java.com/schema/jdk-8u171-linux-x64.rpm
if [ $? -eq 0 ];then
rpm -ivh jdk-8u171-linux-x64.rpm
else
exit 1
fi

##Edit Jdk Env
cat > /etc/profile.d/java.sh <

你可能感兴趣的:(Shell脚本自动部署Java环境)