这是一个检查RPM文件的程序,结果输出到$1.test里面了。
- #!/bin/bash
-
#rpm-check.sh
-
#This script is to describe,list and test if a rpm can install
-
#the fruit save in a file
-
-
-
SUCCESS=0
-
E_NOARGS=65
-
if [ -z "$1'" ]
-
then
-
echo "Usage:'basename $0' rpm-file"
-
exit $E_NOARGS
-
fi
-
{
-
echo "Archive Description:"
-
rpm -qpi $1
-
echo "Archive Listing:"
-
rpm -qpl $1
-
echo
-
rpm -i --test $1
-
-
if [ "$?" -eq $SUCCESS ]
-
then
-
echo "$1 can be install"
-
else
-
echo "$1 cannot be install"
-
fi
-
echo
-
}>"$1.test"
-
echo "Results of rpm test in file $1.test"
阅读(2520) | 评论(0) | 转发(0) |