安装perl的JSON和Exepect监控模块
#!/bin/bash Json="JSON-2.90.tar.gz" Expect="Expect-1.32.tar.gz" IO="IO-Tty-1.12.tar.gz" for rpm in perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker gcc gcc-c++ do rpm -q ${rpm} &>/dev/null || (echo "install $rpm,wait.." && yum -y install ${rpm} &>/dev/null) if [ $? -ne 0 ];then echo "Install $rpm fail,please check it" exit 0 fi done for software in ${Json} ${Expect} ${IO} do cd /usr/local/src rsync -ar rsync://[email protected]/upload/${software} . tar -xf ${software} && softwaredir=`echo ${software} | sed ‘s/\.tar.gz//g‘` && cd ${softwaredir} perl Makefile.PL >/dev/null 2>&1 make >/dev/null 2>&1 make install >/dev/null 2>&1 cd /usr/local/src && rm -rf ${software} ${softwaredir} done cat >test.pl <<EOF #!/usr/bin/perl use JSON; use Expect; EOF /usr/bin/perl test.pl if [ $? -eq 0 ];then echo "Install OK" else echo "Install Fail" fi
本文出自 “Happy实验室” 博客,谢绝转载!
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。