#!/bin/sh -e
# postinst for grml

# starting with grml 0.7 we are using /bin/bash as /bin/sh
# as Debian does not support /bin/zsh as /bin/sh.
case "${1:-}" in
  configure|reconfigure)
  if [ "$1" = "configure" ] && [ -n "${2:-}" ] ; then
     if dpkg --compare-versions "$2" lt 0.7 ; then
       # find target of /bin/sh
       set -- `ls -l /bin/sh`
       target=`eval echo \\${$#}`

       if [ "$target" = /bin/bash ] ; then
          echo "Notice: /bin/sh already points to /bin/bash. Nothing to be done."
       else
          echo
          echo "Notice: /bin/sh does not point to /bin/bash."
          echo "        This might cause serious problems as Debian does not support /bin/zsh as /bin/sh."
          echo -n "Updating symlink: "
          ln -sf /bin/bash /bin/sh && echo "done. /bin/sh points to /bin/bash now."
          echo
       fi
     fi
  fi
  ;;
esac
# EOF
