常有脚本1
时间:2010-07-26 来源:liyongfeng410799624
判断hpacucli rpm包是否安装,如果没有安装执行命令安装
#!/bin/bash
if [ ! -f /usr/sbin/hpacucli ]
then
echo 'hpacucli-7.85-18.linux.rpm is not install'
echo 'please install hpacucli-7.85-18.linux.rpm' rpm -ivh hpacucli-7.85-18.linux.rpm > /dev/null 2>&1 sleep 10 echo 'hpacucli-7.85-18.linux.rpm install done'
fi 判断用户级别脚本 if [ ! `whoami` = root ]
then
echo -e "\e[31;1m ERROR:It is able to executed only by user ROOT.\e[0m"
exit 1
fi
if [ ! -f /usr/sbin/hpacucli ]
then
echo 'hpacucli-7.85-18.linux.rpm is not install'
echo 'please install hpacucli-7.85-18.linux.rpm' rpm -ivh hpacucli-7.85-18.linux.rpm > /dev/null 2>&1 sleep 10 echo 'hpacucli-7.85-18.linux.rpm install done'
fi 判断用户级别脚本 if [ ! `whoami` = root ]
then
echo -e "\e[31;1m ERROR:It is able to executed only by user ROOT.\e[0m"
exit 1
fi
相关阅读 更多 +