#!/bin/bash #Copyright 2003 William Stearns #Released under the GPL. Version=0.1 echo "replace_blacklist version $Version" echo "http://www.stearns.org/sa-blacklist" requireutil () { while [ -n "$1" ]; do if ! type -path "$1" >/dev/null 2>/dev/null ; then echo Missing utility "$1". Please install it. >&2 return 1 #False, app is not available. fi shift done return 0 #True, app is there. } #End of requireutil requireutil basename cat grep mktemp rm rsync sed || exit 1 if [ -z "$1" ] || [ -z "$2" ]; then cat <$TmpFile ( cat "$TmpFile" | sed -e '/#### Start of Manual Blacklist ####/,/#### End of manual blacklist ####/{d;}' ; cat "$Blacklist" ; echo ) >"$1" #Comment the next line if you're trying out the script and want to leave a copy of the original file in /tmp rm -f "$TmpFile" shift done