Thursday, March 25, 2010

BASH bleg

I've got a script provided by Oracle.  I don't like it - it does not play well with my init script.  Before I tear down that fence I'd like to try to understand why the fence was built the way it was.

The Script

#!/bin/sh
. ./setEnv.sh
HOST_NAME=deprecated
WLS_USERNAME=superadmin
export WLS_USERNAME
WLS_PW=agile
export WLS_PW
$JAVA_HOME/bin/java -classpath $CLASSPATH weblogic.Admin -url $HOST_NAME:7001 SHUTDOWN -username $WLS_USERNAME -password $WLS_PW

I'm confused about line 2.  setEnv.sh is important - a lot of environment information specific to my install is in there that the app needs to start and stop.

The problem with this if you call it from a script that lives in /etc/init.d it fails: " ./setEnv.sh: not found".

Is there a reason for doing it this way over capturing the directory into a variable using dirname?
blog comments powered by Disqus