1#!/bin/sh 2 3if [ "$1" = "" ]; then 4 echo "Usage: $0 /somewhere/.htaccess" 5 exit 1 6fi 7 8if [ ! -w $1 ]; then 9 echo "You cannot write to $1" 10 exit 1 11fi 12 13TMPFILE=tmpfile.$$ 14 15awk -f htaccessfix.awk <$1 >$TMPFILE 16 17if [ "$?" != 0 ]; then 18 exit 1 19fi 20 21mv -f $1 $1.orig 22mv -f $TMPFILE $1 23exit 0 24 25