#!/bin/sh
# $FreeBSD: ports/lang/tcl-tk-wrapper/files/wish.in,v 1.1 2007/03/06 19:38:10 miwi Exp $
#
# Wrapper for the tk shell "wish"

WISH=
TCLTK_CONF=/usr/local/etc/tcltk.conf

if [ -f "${TCLTK_CONF}" ]; then
  . ${TCLTK_CONF}
  if [ -n "${WISH}" ]; then
    if [ -x "${WISH}" ]; then
      exec ${WISH} "$@"
    else
      echo "File not found or not executable: ${WISH}" 
      echo "Please check variable WISH in: ${TCLTK_CONF}"
    fi
  else
    echo "Path to default wish shell is not set in the configuration file:"
    echo "/usr/local/etc/tcltk.conf"
    echo "Please see the sample configuration file for details:"
    echo "/usr/local/etc/tcltk.conf.sample"
  fi
  echo ""
  echo "You may need a wish shell installed to use this wrapper from ports like:"
  echo "x11-toolkits/tk84 or x11-toolkits/tk85"
else
  echo "Configuration file not found: /usr/local/etc/tcltk.conf"
  echo "Please see the sample configuration file for details:"
  echo "/usr/local/etc/tcltk.conf.sample"
fi
