pre_install() {
  echo 
  echo "==> Disable networkmanager,dhcdbd or other networking" 
  echo "==> utility and add 'wicd' to DAEMONS"
  echo "==> in /etc/rc.conf"
  echo "==> 'dbus' HAS to be before 'wicd' in rc.conf in the "
  echo "==> DAEMONS array"
}

pre_upgrade() {
  [ -f /var/run/daemons/wicd ] && cp /var/run/daemons/wicd /var/run/daemons/wicd.pid && /etc/rc.d/wicd stop
  pre_install $*
}

post_install() {
  echo
  echo "Wireless Interface Connection Daemon"
  echo
  echo "==> To run: wicd-client"
  sleep 1
    
}

post_upgrade() {
  [ -f /var/run/daemons/wicd.pid ] && rm /var/run/daemons/wicd.pid && /etc/rc.d/wicd start
  post_install $*
}

op=$1
shift
$op $*
