You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
282 B

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