mirror of
https://github.com/YunoHost-Apps/guacamole_ynh.git
synced 2024-09-03 19:16:03 +02:00
Fix clumsy check that tomcat is active/running ... if [ $(cmd) ] or if [ $var ] is hella ambiguous ...
This commit is contained in:
parent
97e2d4cb5c
commit
d2c190549b
3 changed files with 6 additions and 41 deletions
|
@ -17,22 +17,10 @@ ynh_script_progression --message="Stopping system tomcat..." --weight=1
|
||||||
# Guacamole depends on Apache Tomcat.
|
# Guacamole depends on Apache Tomcat.
|
||||||
# But installing Tomcat from the Debian repos automatically enables and starts it.
|
# But installing Tomcat from the Debian repos automatically enables and starts it.
|
||||||
# So we stop and disable it, unless Tomcat was already enabled or started by the user beforehand
|
# So we stop and disable it, unless Tomcat was already enabled or started by the user beforehand
|
||||||
|
if systemctl is-enabled $tomcat_version --quiet 2>/dev/null; then
|
||||||
tomcat_enabled=""
|
|
||||||
tomcat_active=""
|
|
||||||
if [ "$(systemctl cat $tomcat_version --quiet)" ]; then
|
|
||||||
if (systemctl is-enabled $tomcat_version --quiet); then
|
|
||||||
tomcat_enabled=1
|
|
||||||
fi
|
|
||||||
if (systemctl is-active $tomcat_version --quiet); then
|
|
||||||
tomcat_active=1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $tomcat_enabled ]; then
|
|
||||||
systemctl disable $tomcat_version --quiet
|
systemctl disable $tomcat_version --quiet
|
||||||
fi
|
fi
|
||||||
if [ $tomcat_active ]; then
|
if systemctl is-active $tomcat_version --quiet 2>/dev/null; then
|
||||||
systemctl stop $tomcat_version --quiet
|
systemctl stop $tomcat_version --quiet
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -15,21 +15,10 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Stopping system tomcat..." --weight=1
|
ynh_script_progression --message="Stopping system tomcat..." --weight=1
|
||||||
|
|
||||||
tomcat_enabled=""
|
if systemctl is-enabled $tomcat_version --quiet 2>/dev/null; then
|
||||||
tomcat_active=""
|
|
||||||
if [ "$(systemctl cat $tomcat_version --quiet)" ]; then
|
|
||||||
if (systemctl is-enabled $tomcat_version --quiet); then
|
|
||||||
tomcat_enabled=1
|
|
||||||
fi
|
|
||||||
if (systemctl is-active $tomcat_version --quiet); then
|
|
||||||
tomcat_active=1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! $tomcat_enabled ]; then
|
|
||||||
systemctl disable $tomcat_version --quiet
|
systemctl disable $tomcat_version --quiet
|
||||||
fi
|
fi
|
||||||
if [ ! $tomcat_active ]; then
|
if systemctl is-active $tomcat_version --quiet 2>/dev/null; then
|
||||||
systemctl stop $tomcat_version --quiet
|
systemctl stop $tomcat_version --quiet
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -62,22 +62,10 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=1
|
||||||
# Guacamole depends on Apache Tomcat.
|
# Guacamole depends on Apache Tomcat.
|
||||||
# But installing Tomcat from the Debian repos automatically enables and starts it.
|
# But installing Tomcat from the Debian repos automatically enables and starts it.
|
||||||
# So we stop and disable it, unless Tomcat was already enabled or started by the user beforehand
|
# So we stop and disable it, unless Tomcat was already enabled or started by the user beforehand
|
||||||
|
if systemctl is-enabled $tomcat_version --quiet 2>/dev/null; then
|
||||||
tomcat_enabled=""
|
|
||||||
tomcat_active=""
|
|
||||||
if [ "$(systemctl cat $tomcat_version --quiet)" ]; then
|
|
||||||
if (systemctl is-enabled $tomcat_version --quiet); then
|
|
||||||
tomcat_enabled=1
|
|
||||||
fi
|
|
||||||
if (systemctl is-active $tomcat_version --quiet); then
|
|
||||||
tomcat_active=1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! $tomcat_enabled ]; then
|
|
||||||
systemctl disable $tomcat_version --quiet
|
systemctl disable $tomcat_version --quiet
|
||||||
fi
|
fi
|
||||||
if [ ! $tomcat_active ]; then
|
if systemctl is-active $tomcat_version --quiet 2>/dev/null; then
|
||||||
systemctl stop $tomcat_version --quiet
|
systemctl stop $tomcat_version --quiet
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue