Commit dd4ccca3 authored by Claes Sjofors's avatar Claes Sjofors

Merge branch 'master' of newton:/data1/x0-0-0/pwr

parents da5ec1da c3200ed1
...@@ -35,18 +35,15 @@ else ...@@ -35,18 +35,15 @@ else
fi fi
export pwra_db=/usr/pwrp/adm/db 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 if [ "$jdk" == "" ]; then
jdk=`eval ls -t /usr/local | grep ^jre` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
export jdk=/usr/local/$jdk export jdk=/usr/local/$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/pwrrt/pwr stop' alias pwr_stop='/etc/pwrrt/pwr stop'
alias pwr_stop.sh="/etc/pwrrt/pwr stop" alias pwr_stop.sh="/etc/pwrrt/pwr stop"
......
...@@ -20,10 +20,10 @@ export pwr_load=$pwrb_root/load ...@@ -20,10 +20,10 @@ export pwr_load=$pwrb_root/load
export pwr_lis=$pwrb_root/lis export pwr_lis=$pwrb_root/lis
export pwr_doc=$pwrb_root/doc export pwr_doc=$pwrb_root/doc
export pwrp_exe=$pwrp_root/x86_64_openbsd/exe export pwrp_exe=$pwrp_root/x86_64_cygwin/exe
export pwrp_lib=$pwrp_root/x86_64_openbsd/lib export pwrp_lib=$pwrp_root/x86_64_cygwin/lib
export pwrp_obj=$pwrp_root/x86_64_openbsd/obj export pwrp_obj=$pwrp_root/x86_64_cygwin/obj
export pwrp_lis=$pwrp_root/x86_64_openbsd/lis export pwrp_lis=$pwrp_root/x86_64_cygwin/lis
export pwrp_inc=$pwrp_root/common/inc export pwrp_inc=$pwrp_root/common/inc
export pwrp_load=$pwrp_root/common/load export pwrp_load=$pwrp_root/common/load
export pwrp_log=$pwrp_root/common/log export pwrp_log=$pwrp_root/common/log
...@@ -35,18 +35,15 @@ else ...@@ -35,18 +35,15 @@ else
fi fi
export pwra_db=/usr/pwrp/adm/db 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 if [ "$jdk" == "" ]; then
jdk=`eval ls -t /usr/local | grep ^jre` jdk=`eval ls -1 /usr/local | sort -r | grep ^jre | head -1`
fi fi
export jdk=/usr/local/$jdk export jdk=/usr/local/$jdk
export jdk_home=$jdk/bin export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/pwrrt/pwr stop' alias pwr_stop='/etc/pwrrt/pwr stop'
alias pwr_stop.sh="/etc/pwrrt/pwr stop" alias pwr_stop.sh="/etc/pwrrt/pwr stop"
......
...@@ -19,7 +19,7 @@ pwra_set_func() ...@@ -19,7 +19,7 @@ pwra_set_func()
# Command is "set base" # Command is "set base"
basename=$2 basename=$2
basename=${basename//\./\\.} basename=${basename//\./\\.}
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "\s"$basename"\s" | grep "^"%base"\s" | awk '{print $3}'` baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep -a "\s"$basename"\s" | grep -a "^"%base"\s" | awk '{print $3}'`
if [ -z $baseroot ]; then if [ -z $baseroot ]; then
echo "Unable to find base '$2'" echo "Unable to find base '$2'"
return return
...@@ -66,14 +66,14 @@ pwra_set_func() ...@@ -66,14 +66,14 @@ pwra_set_func()
# Command is "set project" # Command is "set project"
project=$2 project=$2
basename=`eval cat $pwra_db/pwr_projectlist.dat | grep "^"$project"\b" | awk '{print $2}'` basename=`eval cat $pwra_db/pwr_projectlist.dat | grep -a "^"$project"\b" | awk '{print $2}'`
basename=${basename//\./\\.} basename=${basename//\./\\.}
if [ -z $basename ]; then if [ -z $basename ]; then
echo "Unable to find project '$2'" echo "Unable to find project '$2'"
return return
fi fi
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "\s"$basename"\s" | grep "^"%base"\s" | awk '{print $3}'` baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep -a "\s"$basename"\s" | grep -a "^"%base"\s" | awk '{print $3}'`
if [ -z $baseroot ]; then if [ -z $baseroot ]; then
echo "Unable to find base '$2'" echo "Unable to find base '$2'"
return return
......
...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/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 ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/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 ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwrsvestop' alias pwr_stop='/etc/init.d/pwrsvestop'
alias pwr_stop.sh="/etc/init.d/pwrsev stop" alias pwr_stop.sh="/etc/init.d/pwrsev stop"
......
...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/local/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/etc/init.d/pwr stop" alias pwr_stop.sh="/etc/init.d/pwr stop"
......
...@@ -19,7 +19,7 @@ pwra_set_func() ...@@ -19,7 +19,7 @@ pwra_set_func()
# Command is "set base" # Command is "set base"
basename=$2 basename=$2
basename=${basename//\./\\.} basename=${basename//\./\\.}
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "\s"$basename"\s" | grep "^"%base"\s" | awk '{print $3}'` baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep -a "\s"$basename"\s" | grep -a "^"%base"\s" | awk '{print $3}'`
if [ -z $baseroot ]; then if [ -z $baseroot ]; then
echo "Unable to find base '$2'" echo "Unable to find base '$2'"
return return
...@@ -66,14 +66,14 @@ pwra_set_func() ...@@ -66,14 +66,14 @@ pwra_set_func()
# Command is "set project" # Command is "set project"
project=$2 project=$2
basename=`eval cat $pwra_db/pwr_projectlist.dat | grep "^"$project"\b" | awk '{print $2}'` basename=`eval cat $pwra_db/pwr_projectlist.dat | grep -a "^"$project"\b" | awk '{print $2}'`
basename=${basename//\./\\.} basename=${basename//\./\\.}
if [ -z $basename ]; then if [ -z $basename ]; then
echo "Unable to find project '$2'" echo "Unable to find project '$2'"
return return
fi fi
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "\s"$basename"\s" | grep "^"%base"\s" | awk '{print $3}'` baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep -a "\s"$basename"\s" | grep -a "^"%base"\s" | awk '{print $3}'`
if [ -z $baseroot ]; then if [ -z $baseroot ]; then
echo "Unable to find base '$2'" echo "Unable to find base '$2'"
return return
......
...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/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 ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/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 ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwrsvestop' alias pwr_stop='/etc/init.d/pwrsvestop'
alias pwr_stop.sh="/etc/init.d/pwrsev stop" alias pwr_stop.sh="/etc/init.d/pwrsev stop"
......
...@@ -35,17 +35,21 @@ else ...@@ -35,17 +35,21 @@ else
fi fi
export pwra_db=/usr/pwrp/adm/db export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/local | grep ^jdk`
if [ "$jdk" == "" ]; then # Check /usr/local first since it ought to have priority
jdk=`eval ls -t /usr/local | grep ^jre` 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 fi
export jdk=/usr/local/$jdk if ! [ -z "$jdk" ]; then
export jdk_home=$jdk/bin export jdk=/usr/local/$jdk
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
#Set display to remote computer PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/pwrrt/pwr stop' alias pwr_stop='/etc/pwrrt/pwr stop'
......
...@@ -35,17 +35,21 @@ else ...@@ -35,17 +35,21 @@ else
fi fi
export pwra_db=/usr/pwrp/adm/db export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/local | grep ^jdk`
if [ "$jdk" == "" ]; then # Check /usr/local first since it ought to have priority
jdk=`eval ls -t /usr/local | grep ^jre` 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 fi
export jdk=/usr/local/$jdk if ! [ -z "$jdk" ]; then
export jdk_home=$jdk/bin export jdk=/usr/local/$jdk
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
#Set display to remote computer PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/pwrrt/pwr stop' alias pwr_stop='/etc/pwrrt/pwr stop'
......
...@@ -19,7 +19,7 @@ pwra_set_func() ...@@ -19,7 +19,7 @@ pwra_set_func()
# Command is "set base" # Command is "set base"
basename=$2 basename=$2
basename=${basename//\./\\.} basename=${basename//\./\\.}
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "\s"$basename"\s" | grep "^"%base"\s" | awk '{print $3}'` baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep -a "\s"$basename"\s" | grep -a "^"%base"\s" | awk '{print $3}'`
if [ -z $baseroot ]; then if [ -z $baseroot ]; then
echo "Unable to find base '$2'" echo "Unable to find base '$2'"
return return
...@@ -60,14 +60,14 @@ pwra_set_func() ...@@ -60,14 +60,14 @@ pwra_set_func()
# Command is "set project" # Command is "set project"
project=$2 project=$2
basename=`eval cat $pwra_db/pwr_projectlist.dat | grep "^"$project"\b" | awk '{print $2}'` basename=`eval cat $pwra_db/pwr_projectlist.dat | grep -a "^"$project"\b" | awk '{print $2}'`
basename=${basename//\./\\.} basename=${basename//\./\\.}
if [ -z $basename ]; then if [ -z $basename ]; then
echo "Unable to find project '$2'" echo "Unable to find project '$2'"
return return
fi fi
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "\s"$basename"\s" | grep "^"%base"\s" | awk '{print $3}'` baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep -a "\s"$basename"\s" | grep -a "^"%base"\s" | awk '{print $3}'`
if [ -z $baseroot ]; then if [ -z $baseroot ]; then
echo "Unable to find base '$2'" echo "Unable to find base '$2'"
return return
......
...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/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 ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/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 ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwrsvestop' alias pwr_stop='/etc/init.d/pwrsvestop'
alias pwr_stop.sh="/etc/init.d/pwrsev stop" alias pwr_stop.sh="/etc/init.d/pwrsev stop"
......
...@@ -31,17 +31,21 @@ export pwrp_db=$pwrp_root/common/db ...@@ -31,17 +31,21 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/local/$jdk if ! [ -z "$jdk" ]; then
export jdk_home=$jdk/bin export jdk=/usr/local/$jdk
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
#Set display to remote computer PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
......
...@@ -31,17 +31,21 @@ export pwrp_db=$pwrp_root/common/db ...@@ -31,17 +31,21 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/local/$jdk if ! [ -z "$jdk" ]; then
export jdk_home=$jdk/bin export jdk=/usr/local/$jdk
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
#Set display to remote computer PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
......
...@@ -31,12 +31,21 @@ export pwrp_db=$pwrp_root/common/db ...@@ -31,12 +31,21 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 # Check /usr/local first since it ought to have priority
export DISPLAY=$REMOTEHOST:0.0 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwrsvestop' alias pwr_stop='/etc/init.d/pwrsvestop'
......
...@@ -31,17 +31,21 @@ export pwrp_db=$pwrp_root/common/db ...@@ -31,17 +31,21 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/local/$jdk if ! [ -z "$jdk" ]; then
export jdk_home=$jdk/bin export jdk=/usr/local/$jdk
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
#Set display to remote computer PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
......
...@@ -31,17 +31,21 @@ export pwrp_db=$pwrp_root/common/db ...@@ -31,17 +31,21 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/local/$jdk if ! [ -z "$jdk" ]; then
export jdk_home=$jdk/bin export jdk=/usr/local/$jdk
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home export JAVA_HOME=$jdk
export jdk_home=$jdk/bin
fi
#Set display to remote computer PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
......
...@@ -31,12 +31,21 @@ export pwrp_db=$pwrp_root/common/db ...@@ -31,12 +31,21 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 # Check /usr/local first since it ought to have priority
export DISPLAY=$REMOTEHOST:0.0 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwrsvestop' alias pwr_stop='/etc/init.d/pwrsvestop'
......
...@@ -19,7 +19,7 @@ pwra_set_func() ...@@ -19,7 +19,7 @@ pwra_set_func()
# Command is "set base" # Command is "set base"
basename=$2 basename=$2
basename=${basename//\./\\.} basename=${basename//\./\\.}
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "\s"$basename"\s" | grep "^"%base"\s" | awk '{print $3}'` baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep -a "\s"$basename"\s" | grep -a "^"%base"\s" | awk '{print $3}'`
if [ -z $baseroot ]; then if [ -z $baseroot ]; then
echo "Unable to find base '$2'" echo "Unable to find base '$2'"
return return
...@@ -66,14 +66,14 @@ pwra_set_func() ...@@ -66,14 +66,14 @@ pwra_set_func()
# Command is "set project" # Command is "set project"
project=$2 project=$2
basename=`eval cat $pwra_db/pwr_projectlist.dat | grep "^"$project"\b" | awk '{print $2}'` basename=`eval cat $pwra_db/pwr_projectlist.dat | grep -a "^"$project"\b" | awk '{print $2}'`
basename=${basename//\./\\.} basename=${basename//\./\\.}
if [ -z $basename ]; then if [ -z $basename ]; then
echo "Unable to find project '$2'" echo "Unable to find project '$2'"
return return
fi fi
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "\s"$basename"\s" | grep "^"%base"\s" | awk '{print $3}'` baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep -a "\s"$basename"\s" | grep -a "^"%base"\s" | awk '{print $3}'`
if [ -z $baseroot ]; then if [ -z $baseroot ]; then
echo "Unable to find base '$2'" echo "Unable to find base '$2'"
return return
......
...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/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 ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/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 ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwrsvestop' alias pwr_stop='/etc/init.d/pwrsvestop'
alias pwr_stop.sh="/etc/init.d/pwrsev stop" alias pwr_stop.sh="/etc/init.d/pwrsev stop"
......
...@@ -19,7 +19,7 @@ pwra_set_func() ...@@ -19,7 +19,7 @@ pwra_set_func()
# Command is "set base" # Command is "set base"
basename=$2 basename=$2
basename=${basename//\./\\.} basename=${basename//\./\\.}
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "\s"$basename"\s" | grep "^"%base"\s" | awk '{print $3}'` baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep -a "\s"$basename"\s" | grep -a "^"%base"\s" | awk '{print $3}'`
if [ -z $baseroot ]; then if [ -z $baseroot ]; then
echo "Unable to find base '$2'" echo "Unable to find base '$2'"
return return
...@@ -66,14 +66,14 @@ pwra_set_func() ...@@ -66,14 +66,14 @@ pwra_set_func()
# Command is "set project" # Command is "set project"
project=$2 project=$2
basename=`eval cat $pwra_db/pwr_projectlist.dat | grep "^"$project"\b" | awk '{print $2}'` basename=`eval cat $pwra_db/pwr_projectlist.dat | grep -a "^"$project"\b" | awk '{print $2}'`
basename=${basename//\./\\.} basename=${basename//\./\\.}
if [ -z $basename ]; then if [ -z $basename ]; then
echo "Unable to find project '$2'" echo "Unable to find project '$2'"
return return
fi fi
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "\s"$basename"\s" | grep "^"%base"\s" | awk '{print $3}'` baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep -a "\s"$basename"\s" | grep -a "^"%base"\s" | awk '{print $3}'`
if [ -z $baseroot ]; then if [ -z $baseroot ]; then
echo "Unable to find base '$2'" echo "Unable to find base '$2'"
return return
......
...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/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 ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/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 ...@@ -31,18 +31,33 @@ export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db 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 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 fi
export jdk=/usr/lib/jvm/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home 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 #symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwrsvestop' alias pwr_stop='/etc/init.d/pwrsvestop'
alias pwr_stop.sh="/etc/init.d/pwrsev stop" alias pwr_stop.sh="/etc/init.d/pwrsev stop"
......
...@@ -113,7 +113,7 @@ OpGtk::OpGtk( void *op_parent_ctx, ...@@ -113,7 +113,7 @@ OpGtk::OpGtk( void *op_parent_ctx,
text_size(12) text_size(12)
{ {
pwr_tStatus sts; pwr_tStatus sts;
int root_width, root_height; GdkRectangle xtt_monitor_geometry;
GdkColor black_color; GdkColor black_color;
memset( a_exist, 0, sizeof(a_exist)); memset( a_exist, 0, sizeof(a_exist));
...@@ -126,7 +126,6 @@ OpGtk::OpGtk( void *op_parent_ctx, ...@@ -126,7 +126,6 @@ OpGtk::OpGtk( void *op_parent_ctx,
gdk_color_parse( "Black", &black_color); gdk_color_parse( "Black", &black_color);
gdk_color_parse( "White", &white_color); gdk_color_parse( "White", &white_color);
toplevel = (GtkWidget *) g_object_new( GTK_TYPE_WINDOW, toplevel = (GtkWidget *) g_object_new( GTK_TYPE_WINDOW,
"default-height", OP_HEIGHT_MIN, "default-height", OP_HEIGHT_MIN,
"default-width", 1100, "default-width", 1100,
...@@ -134,11 +133,9 @@ OpGtk::OpGtk( void *op_parent_ctx, ...@@ -134,11 +133,9 @@ OpGtk::OpGtk( void *op_parent_ctx,
gtk_window_set_decorated( GTK_WINDOW(toplevel), FALSE); gtk_window_set_decorated( GTK_WINDOW(toplevel), FALSE);
CoWowGtk::SetWindowIcon( toplevel); CoWowGtk::SetWindowIcon( toplevel);
GdkWindow *rootwindow = gtk_widget_get_root_window( toplevel); GdkScreen *xtt_screen = gtk_widget_get_screen(toplevel);
gdk_drawable_get_size( rootwindow, &root_width, &root_height); int xtt_monitor = gdk_screen_get_monitor_at_point(xtt_screen, 0, 0);
if ( root_width / root_height >= 2) gdk_screen_get_monitor_geometry(xtt_screen, xtt_monitor, &xtt_monitor_geometry);
// Assume two screens
root_width = root_width / 2;
pwr_tFileName fname; pwr_tFileName fname;
dcli_translate_filename( fname, "$pwr_exe/xtt_alarm_active.png"); dcli_translate_filename( fname, "$pwr_exe/xtt_alarm_active.png");
...@@ -668,12 +665,12 @@ OpGtk::OpGtk( void *op_parent_ctx, ...@@ -668,12 +665,12 @@ OpGtk::OpGtk( void *op_parent_ctx,
if ( sup_vect.size() > 10) { if ( sup_vect.size() > 10) {
padding1 = 0; padding1 = 0;
padding2 = 0; padding2 = 0;
buttonwidth = (root_width - 350) / sup_vect.size(); buttonwidth = (xtt_monitor_geometry.width - 350) / sup_vect.size();
} }
else if ( sup_vect.size() > 6) { else if ( sup_vect.size() > 6) {
padding1 = 8; padding1 = 8;
padding2 = 5; padding2 = 5;
buttonwidth = (root_width - 350) / sup_vect.size() - 2 * padding2; buttonwidth = (xtt_monitor_geometry.width - 350) / sup_vect.size() - 2 * padding2;
} }
else { else {
padding1 = 8; padding1 = 8;
...@@ -731,7 +728,7 @@ OpGtk::OpGtk( void *op_parent_ctx, ...@@ -731,7 +728,7 @@ OpGtk::OpGtk( void *op_parent_ctx,
gtk_box_pack_start( GTK_BOX(status_bar), GTK_WIDGET(node_button), FALSE, FALSE, padding2); gtk_box_pack_start( GTK_BOX(status_bar), GTK_WIDGET(node_button), FALSE, FALSE, padding2);
} }
if ( buttonwidth) if ( buttonwidth)
gtk_widget_set_size_request( status_bar, root_width - 6, -1); gtk_widget_set_size_request( status_bar, xtt_monitor_geometry.width, -1);
} }
// Main window // Main window
...@@ -788,7 +785,7 @@ OpGtk::OpGtk( void *op_parent_ctx, ...@@ -788,7 +785,7 @@ OpGtk::OpGtk( void *op_parent_ctx,
activate_aalarm_decr( 0, this); activate_aalarm_decr( 0, this);
} }
gtk_window_resize( GTK_WINDOW(toplevel), root_width - 6, OP_HEIGHT_MIN); gtk_window_resize( GTK_WINDOW(toplevel), xtt_monitor_geometry.width, OP_HEIGHT_MIN);
gtk_window_move( GTK_WINDOW(toplevel), 0, 0); gtk_window_move( GTK_WINDOW(toplevel), 0, 0);
wow = new CoWowGtk( toplevel); wow = new CoWowGtk( toplevel);
......
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