我需要检查RPM包pptpd是否已经安装,而忽略了版本。如果是的话,我想把它移走。如果没有,则检查/etc/pptpd.conf和/etc/ppp/是否存在。如果是的话,那么rm -rf。
发布于 2010-10-27 09:34:11
rpm -q pptpd
if [ $? = 0 ]
then
echo "pptpd installed.. removing"
rpm -e pptp
elif [ -e "/etc/pptpd.conf" ]
then
rm -rf /etc/pptpd.conf
fi但是我想知道您是否需要删除它,检查是否需要存在包/文件?
发布于 2010-10-27 09:44:24
有一种方法:
if rpm --quiet -q pptpd # check for package
then
# the package does exist, remove it
rpm -e pptpd
else
# the package does not exist, so delete the files.
/bin/rm -rf /etc/pptpd.conf /etc/ppphttps://serverfault.com/questions/195254
复制相似问题