digest.sh 844 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. # -----------------------------------------------------------------------------
  3. # Script to digest password using the algorithm specified
  4. #
  5. # $Id: digest.sh,v 1.1 2005/03/05 00:29:13 matt Exp $
  6. # -----------------------------------------------------------------------------
  7. # resolve links - $0 may be a softlink
  8. PRG="$0"
  9. while [ -h "$PRG" ] ; do
  10. ls=`ls -ld "$PRG"`
  11. link=`expr "$ls" : '.*-> \(.*\)$'`
  12. if expr "$link" : '.*/.*' > /dev/null; then
  13. PRG="$link"
  14. else
  15. PRG=`dirname "$PRG"`/"$link"
  16. fi
  17. done
  18. PRGDIR=`dirname "$PRG"`
  19. EXECUTABLE=tool-wrapper.sh
  20. # Check that target executable exists
  21. if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
  22. echo "Cannot find $PRGDIR/$EXECUTABLE"
  23. echo "This file is needed to run this program"
  24. exit 1
  25. fi
  26. exec "$PRGDIR"/"$EXECUTABLE" -server org.apache.catalina.realm.RealmBase "$@"