#!/bin/sh

# Usage: fixlevel chan.db
#
# This fixes broken ALVL (access levels) in chan.db after modechange that
# happened in latest CVS. Simply, it is easiest for all of us to reset
# access levels on all channels to default after bit changes in flags.
# -kre

if [ ! "x$1" = "x" ]; then
  CHANFILE=$1
  if [ -f $CHANFILE ]; then
    echo "Fixing default level in $CHANFILE"
    grep -v ALVL $CHANFILE >> $CHANFILE.$$
    mv $CHANFILE.$$ $CHANFILE
    echo "done"
  fi
  else
  echo "Usage: $0 filename"
  echo " To fix default access level in 'filename'"
  echo " and filename is usually chan.db"
fi
