#!/bin/bash
#####################jdk install##############################
os_version=`uname -a |awk '{ print $12}'`
ftpUser=root
ftpPWD=root6adp2
if [ $UID -ne 0 ] ; then
echo curent user is not root!
exit 4
else
echo current user is root
fi
if [ $os_version=="x86_64" ]; then
echo current OS version is 64bit
/usr/bin/ftp -n<
open 10.14.54.120 21
user $ftpUser $ftpPWD
bin
cd /oradata/java/
get jdk-6u37-linux-x64.bin
bye
quit
EOF
chmod -R 755 ./jdk-*-linux-x64.bin
./jdk-6u37-linux-x64.bin &
sleep 30 && \n
mkdir -p /usr/java
mv jdk1.6.0_37/ /usr/java/
chmod -R 775 /usr/java/
cat >> /etc/profile <
JAVA_HOME=/usr/java/jdk1.6.0_37
JAVA_BIN=/usr/java/jdk1.6.0_37/bin
PATH=/usr/java/jdk1.6.0_37/bin:$PATH
CLASSPATH=.:/usr/java/jdk1.6.0_37/lib/dt.jar:/usr/java/jdk1.6.0_37/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
EOF
source /etc/profile
echo jdk ok !
exit 0
else
echo "current OS version is 32bit"
exit 1
fi
阅读(1186) | 评论(0) | 转发(0) |