git_dir="/home/software"
if [ ! -d "$git_dir" ];then
mkdir -p $git_dir
fi
cd $git_dir
git_gz=$(find `dirname $git_dir` -name *git*.tar.gz)
if [ ! -e "$git_gz" ];then
wget -O git-2.17.0.tar.gz https://github.com/git/git/archive/v2.17.0.tar.gz
if [ $? -ne 0 ];then
echo "远程获取git安装包失败!"
exit 0
fi
git_gz=$(find `dirname $git_dir` -name *git*.tar.gz)
fi
tar -zxvf $git_gz
if [ $? -ne 0 ];then
echo "解压失败!"
exit 0
else
rm -rf $git_gz
fi
git_file=$(find `dirname $giz_dir` -name *git*)
cd $git_file
git_in="/usr/local/webserver/git"
if [ ! -d "$git_in" ];then
mkdir -p $git_in
fi
conf="/etc/profile"
make configure
./configure --prefix=$git_in
make all & make install
if [ $? -ne 0 ];then
echo "编译失败!"
exit 0
# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
# make prefix=$git_in all
# fi
make prefix=$git_in install
echo "export PATH=$PATH:$git_in/bin">>$conf
source $conf