summaryrefslogtreecommitdiff
path: root/type
diff options
context:
space:
mode:
authorDennis Camera <cdist@dtnr.ch>2021-03-19 15:19:04 +0100
committerDennis Camera <cdist@dtnr.ch>2021-03-20 20:31:13 +0100
commitcc4c96911ff94af329a8d7d2dab43bee68d50817 (patch)
treed0ab2f12eea9e99e03abe8712b1fed9994d40aaa /type
parentfec19c2c85d0460525adb3404849fc5b4b036f38 (diff)
download__dtnrch_egov-cc4c96911ff94af329a8d7d2dab43bee68d50817.tar.gz
__dtnrch_egov-cc4c96911ff94af329a8d7d2dab43bee68d50817.zip
[type/__dtnrch_install4j] Use inst_jre for uninstallation
Diffstat (limited to 'type')
-rwxr-xr-xtype/__dtnrch_install4j/gencode-remote39
1 files changed, 28 insertions, 11 deletions
diff --git a/type/__dtnrch_install4j/gencode-remote b/type/__dtnrch_install4j/gencode-remote
index cc08306..784afc9 100755
--- a/type/__dtnrch_install4j/gencode-remote
+++ b/type/__dtnrch_install4j/gencode-remote
@@ -35,18 +35,18 @@ destination=/${__object_id:?}
# Always enable unattended mode
i4j_opts='-q'
-if test -s "${__object:?}/parameter/java-home"
-then
- java_home=$(cat "${__object:?}/parameter/java-home")
-
- target_setenv INSTALL4J_JAVA_HOME "${java_home}"
- target_setenv INSTALL4J_JAVA_HOME_OVERRIDE "${java_home}"
- i4j_opts="${i4j_opts} -manual $(quote "${java_home}")"
-fi
-
case ${state_should}
in
(present)
+ if test -s "${__object:?}/parameter/java-home"
+ then
+ java_home=$(cat "${__object:?}/parameter/java-home")
+
+ target_setenv INSTALL4J_JAVA_HOME "${java_home}"
+ target_setenv INSTALL4J_JAVA_HOME_OVERRIDE "${java_home}"
+ i4j_opts="${i4j_opts} -manual $(quote "${java_home}")"
+ fi
+
i4j_script=$(cat "${__object:?}/parameter/installer")
i4j_vm_opts='-Dinstall4j.suppressUnattendedReboot=true'
@@ -72,10 +72,27 @@ in
(absent)
remote_logs_dir='${__object:?}/logs'
cat <<-EOF
+ if test -f '${destination}/.install4j/inst_jre.cfg'
+ then
+ read INSTALL4J_JAVA_HOME_OVERRIDE <'${destination}/.install4j/inst_jre.cfg'
+ test -d "\${INSTALL4J_JAVA_HOME_OVERRIDE}" || {
+ if test -f '${destination}/.install4j/pref_jre.cfg'
+ then
+ read INSTALL4J_JAVA_HOME_OVERRIDE <'${destination}/.install4j/pref_jre.cfg'
+ fi
+ }
+ if test -d "\${INSTALL4J_JAVA_HOME_OVERRIDE}"
+ then
+ export INSTALL4J_JAVA_HOME_OVERRIDE
+ else
+ unset INSTALL4J_JAVA_HOME_OVERRIDE
+ fi
+ fi
+
mkdir "${remote_logs_dir}" || exit 1
- /bin/sh '${destination}/uninstall' ${i4j_opts} >"${remote_logs_dir}/i4j_stdout" 2>"${remote_logs_dir}/i4j_stderr"
- i4j_exit=$?
+ i4j_exit=0
+ /bin/sh '${destination}/uninstall' ${i4j_opts} >"${remote_logs_dir}/i4j_stdout" 2>"${remote_logs_dir}/i4j_stderr" || i4j_exit=$?
cat <"${remote_logs_dir}/i4j_stdout"
cat >&2 <"${remote_logs_dir}/i4j_stderr"