mikshaw
Group: Members
Posts: 4856
Joined: July 2004 |
|
Posted: Oct. 18 2006,16:57 |
|
Look at /usr/local/bin/links for a simple way to do part of it in lua. This script does not handle files not in PATH, however.
I'm not sure how it would be done in Lua, but something like this might work in Bash: (untested)
Code Sample | #!/bin/sh if which java &>/dev/null; then JAVA=`which java` elif [ -x "/opt/javasomething/bin/java" ]; then JAVA="/opt/javasomething/bin/java" else echo "retrieving jre1_5_0.uci ..." mydsl-load jre1_5_0.uci uci && JAVA="/opt/javasomething/bin/java" fi
if [ -x "${JAVA}" ]; then exec ${JAVA} "$@" else echo "error!" exit 1 fi |
Use this in place of the java command...but don't name it "java" unless it's not in your PATH.
-------------- http://www.tldp.org/LDP/intro-linux/html/index.html
|