Listing 4: SCCSctl--An example suFirewall utility configuration file
#************************************
# SCCSctl - control file and common functions.
#************************************
# Location of s-files.
SCCSBASE=/usr/SCCS
readonly SCCSBASE
# Set environment variables from suFirewall to readonly.
readonly FWREALUID FWSDIR FWREALPPID FWPGM
# Return latest trunk R for s-file.
# usage: FWLatestTrunk file
FWLatestTrunk() {
if [ -r ${SCCSBASE}/s.$1 ]; then
latestsid_tmp=`get -g -t ${SCCSBASE}/s.$1 2>/dev/null`
latesttrunk_tmp=`expr "$latestsid_tmp" : '\([0-9][0-9]*\)\..*'`
echo "$latesttrunk_tmp"
unset latestsid_tmp latestrunk_tmp
return 0
else
return 1
fi
}
# Return all edits on trunk R for s-file.
# usage: FWEditsOnTrunk R file
FWEditsOnTrunk() {
if [ -f ${SCCSBASE}/p.$2 ]; then
awk '
{
if ($2 ~ /'"$1"'\..*/)
print $0
}' ${SCCSBASE}/p.$2
fi
}
|