#!/bin/ksh # Get a list of rpms from the command line. That is, ignore all rpm # options and so on. rpmlist="`echo $* | tr -s ' ' '\n' | grep '\.rpm$'`" for each in $rpmlist do # Get the actual rpm name. rpmname="`rpm -qp "$each" --qf '%{NAME}'`" # Check against given list of rpms to reject. retval="`echo $rpmname | grep -v -q -f reject.rpms; echo $?`" if [ "$retval" != 0 ] then echo "You don't have permission to install $each ($rpmname)." exit 1 fi done exec rpm "$@"