Commit 61ebdf59 authored by Marcus Nordenberg's avatar Marcus Nordenberg

Update pwrp_profile

DISPLAY no longer set in pwrp_profile and some (hopefully working :) )
updates to how we decide what jdk/jre to use.
parent ab7cc22a
......@@ -35,18 +35,15 @@ else
fi
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/local | grep ^jdk`
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ "$jdk" == "" ]; then
jdk=`eval ls -t /usr/local | grep ^jre`
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
export jdk=/usr/local/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/pwrrt/pwr stop'
alias pwr_stop.sh="/etc/pwrrt/pwr stop"
......
......@@ -20,10 +20,10 @@ export pwr_load=$pwrb_root/load
export pwr_lis=$pwrb_root/lis
export pwr_doc=$pwrb_root/doc
export pwrp_exe=$pwrp_root/x86_64_openbsd/exe
export pwrp_lib=$pwrp_root/x86_64_openbsd/lib
export pwrp_obj=$pwrp_root/x86_64_openbsd/obj
export pwrp_lis=$pwrp_root/x86_64_openbsd/lis
export pwrp_exe=$pwrp_root/x86_64_cygwin/exe
export pwrp_lib=$pwrp_root/x86_64_cygwin/lib
export pwrp_obj=$pwrp_root/x86_64_cygwin/obj
export pwrp_lis=$pwrp_root/x86_64_cygwin/lis
export pwrp_inc=$pwrp_root/common/inc
export pwrp_load=$pwrp_root/common/load
export pwrp_log=$pwrp_root/common/log
......@@ -35,18 +35,15 @@ else
fi
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/local | grep ^jdk`
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
if [ "$jdk" == "" ]; then
jdk=`eval ls -t /usr/local | grep ^jre`
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
export jdk=/usr/local/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/pwrrt/pwr stop'
alias pwr_stop.sh="/etc/pwrrt/pwr stop"
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 -e ^java-[0-9]*-openjdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Debian should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/etc/init.d/pwr stop"
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 -e ^java-[0-9]*-openjdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Debian should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/etc/init.d/pwr stop"
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 -e ^java-[0-9]*-openjdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Debian should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwrsvestop'
alias pwr_stop.sh="/etc/init.d/pwrsev stop"
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/local | grep -m 1 ^jdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Debian should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/local | grep -m 1 ^jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/local/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/etc/init.d/pwr stop"
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 -e ^java-[0-9]*-openjdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Debian should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/etc/init.d/pwr stop"
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 -e ^java-[0-9]*-openjdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Debian should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/etc/init.d/pwr stop"
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 -e ^java-[0-9]*-openjdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Debian should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwrsvestop'
alias pwr_stop.sh="/etc/init.d/pwrsev stop"
......
......@@ -35,17 +35,21 @@ else
fi
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/local | grep ^jdk`
if [ "$jdk" == "" ]; then
jdk=`eval ls -t /usr/local | grep ^jre`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
export jdk=/usr/local/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
if ! [ -z "$jdk" ]; then
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/pwrrt/pwr stop'
......
......@@ -35,17 +35,21 @@ else
fi
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/local | grep ^jdk`
if [ "$jdk" == "" ]; then
jdk=`eval ls -t /usr/local | grep ^jre`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
export jdk=/usr/local/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
if ! [ -z "$jdk" ]; then
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/pwrrt/pwr stop'
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 -e ^java-[0-9]*-openjdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Raspbian should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/etc/init.d/pwr stop"
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 -e ^java-[0-9]*-openjdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Raspbian should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk=""
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/etc/init.d/pwr stop"
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 -e ^java-[0-9]*-openjdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Raspbian should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk=""
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwrsvestop'
alias pwr_stop.sh="/etc/init.d/pwrsev stop"
......
......@@ -31,17 +31,21 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/local | grep -m 1 ^jdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/local | grep -m 1 ^jre`
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
export jdk=/usr/local/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
if ! [ -z "$jdk" ]; then
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
......
......@@ -31,17 +31,21 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/local | grep -m 1 ^jdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/local | grep -m 1 ^jre`
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
export jdk=/usr/local/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
if ! [ -z "$jdk" ]; then
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
......
......@@ -31,12 +31,21 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls /usr/local | grep ^jre`
export jdk_home=/usr/local/$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
if ! [ -z "$jdk" ]; then
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwrsvestop'
......
......@@ -31,17 +31,21 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/local | grep -m 1 ^jdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/local | grep -m 1 ^jre`
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
export jdk=/usr/local/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
if ! [ -z "$jdk" ]; then
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
......
......@@ -31,17 +31,21 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/local | grep -m 1 ^jdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/local | grep -m 1 ^jre`
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
export jdk=/usr/local/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
if ! [ -z "$jdk" ]; then
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
......
......@@ -31,12 +31,21 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls /usr/local | grep ^jre`
export jdk_home=/usr/local/$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
if ! [ -z "$jdk" ]; then
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwrsvestop'
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 -e ^java-[0-9]*-openjdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Ubuntu should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/etc/init.d/pwr stop"
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 -e ^java-[0-9]*-openjdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Ubuntu should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/etc/init.d/pwr stop"
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 -e ^java-[0-9]*-openjdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Ubuntu should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwrsvestop'
alias pwr_stop.sh="/etc/init.d/pwrsev stop"
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 -e ^java-[0-9]*-openjdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Ubuntu should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/etc/init.d/pwr stop"
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 -e ^java-[0-9]*-openjdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Ubuntu should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/etc/init.d/pwr stop"
......
......@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 -e ^java-[0-9]*-openjdk`
# Check /usr/local first since it ought to have priority
jdk=`eval ls -1 /usr/local | sort -r | grep ^jdk | head -1`
# Check if any JRE is present in /usr/local
if [ -z "$jdk" ]; then
jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi
# If no local jdk/jres were found check for openjdk. Ubuntu should have a default-java
# symlink in /usr/lib/jvm which can be changed with update-java-alternatives if openjdk
# is in use
if [ -z "$jdk" ]; then
jdk=`eval ls -t /usr/lib/jvm | grep -m 1 jre`
jdk=`eval realpath -qe /usr/lib/jvm/default-java`
if [ $? != 0 ]; then
jdk="";
else
export jdk=$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
else
export jdk=/usr/local/$jdk
export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwrsvestop'
alias pwr_stop.sh="/etc/init.d/pwrsev stop"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment