handles spaces around hostname

((users doubleclick a host name and paste result in the installer)
This commit is contained in:
gpatel-fr 2021-03-04 12:29:06 +01:00 committed by Дамян Минков
parent 5c46b03251
commit 29bbcf8590
6 changed files with 9 additions and 9 deletions

View File

@ -35,7 +35,7 @@ case "$1" in
db_input critical jitsi-videobridge/jvb-hostname || true db_input critical jitsi-videobridge/jvb-hostname || true
db_go db_go
fi fi
JVB_HOSTNAME="$RET" JVB_HOSTNAME=$(echo "$RET" | xargs echo -n)
db_get jitsi-videobridge/jvbsecret db_get jitsi-videobridge/jvbsecret
if [ -z "$RET" ] ; then if [ -z "$RET" ] ; then
@ -64,7 +64,7 @@ case "$1" in
# detect dpkg-reconfigure, just delete old links # detect dpkg-reconfigure, just delete old links
db_get jitsi-meet-prosody/jvb-hostname db_get jitsi-meet-prosody/jvb-hostname
JVB_HOSTNAME_OLD=$RET JVB_HOSTNAME_OLD=$(echo "$RET" | xargs echo -n)
if [ -n "$RET" ] && [ ! "$JVB_HOSTNAME_OLD" = "$JVB_HOSTNAME" ] ; then if [ -n "$RET" ] && [ ! "$JVB_HOSTNAME_OLD" = "$JVB_HOSTNAME" ] ; then
rm -f /etc/prosody/conf.d/$JVB_HOSTNAME_OLD.cfg.lua rm -f /etc/prosody/conf.d/$JVB_HOSTNAME_OLD.cfg.lua
rm -f /etc/prosody/certs/$JVB_HOSTNAME_OLD.key rm -f /etc/prosody/certs/$JVB_HOSTNAME_OLD.key

View File

@ -31,7 +31,7 @@ case "$1" in
purge) purge)
db_get jitsi-meet-prosody/jvb-hostname db_get jitsi-meet-prosody/jvb-hostname
JVB_HOSTNAME=$RET JVB_HOSTNAME=$(echo "$RET" | xargs echo -n)
if [ -n "$RET" ]; then if [ -n "$RET" ]; then
rm -f /etc/prosody/conf.avail/$JVB_HOSTNAME.cfg.lua rm -f /etc/prosody/conf.avail/$JVB_HOSTNAME.cfg.lua
rm -f /etc/prosody/conf.d/$JVB_HOSTNAME.cfg.lua rm -f /etc/prosody/conf.d/$JVB_HOSTNAME.cfg.lua

View File

@ -25,7 +25,7 @@ case "$1" in
. /usr/share/debconf/confmodule . /usr/share/debconf/confmodule
db_get jitsi-meet-prosody/jvb-hostname db_get jitsi-meet-prosody/jvb-hostname
JVB_HOSTNAME="$RET" JVB_HOSTNAME=$(echo "$RET" | xargs echo -n)
db_get jitsi-meet-tokens/appid db_get jitsi-meet-tokens/appid
if [ "$RET" = "false" ] ; then if [ "$RET" = "false" ] ; then

View File

@ -30,7 +30,7 @@ case "$1" in
db_input critical jitsi-videobridge/jvb-hostname || true db_input critical jitsi-videobridge/jvb-hostname || true
db_go db_go
fi fi
JVB_HOSTNAME="$RET" JVB_HOSTNAME=$(echo "$RET" | xargs echo -n)
TURN_CONFIG="/etc/turnserver.conf" TURN_CONFIG="/etc/turnserver.conf"
NGINX_CONFIG="/etc/nginx/sites-available/$JVB_HOSTNAME.conf" NGINX_CONFIG="/etc/nginx/sites-available/$JVB_HOSTNAME.conf"
@ -44,7 +44,7 @@ case "$1" in
# detect dpkg-reconfigure, just delete old links # detect dpkg-reconfigure, just delete old links
db_get jitsi-meet-turnserver/jvb-hostname db_get jitsi-meet-turnserver/jvb-hostname
JVB_HOSTNAME_OLD=$RET JVB_HOSTNAME_OLD=$(echo "$RET" | xargs echo -n)
if [ -n "$RET" ] && [ ! "$JVB_HOSTNAME_OLD" = "$JVB_HOSTNAME" ] ; then if [ -n "$RET" ] && [ ! "$JVB_HOSTNAME_OLD" = "$JVB_HOSTNAME" ] ; then
if [[ -f $TURN_CONFIG ]] && grep -q "jitsi-meet coturn config" "$TURN_CONFIG" ; then if [[ -f $TURN_CONFIG ]] && grep -q "jitsi-meet coturn config" "$TURN_CONFIG" ; then
rm -f $TURN_CONFIG rm -f $TURN_CONFIG

View File

@ -32,12 +32,12 @@ case "$1" in
db_go db_go
db_get jitsi-videobridge/jvb-hostname db_get jitsi-videobridge/jvb-hostname
fi fi
JVB_HOSTNAME="$RET" JVB_HOSTNAME=$(echo "$RET" | xargs echo -n)
# detect dpkg-reconfigure # detect dpkg-reconfigure
RECONFIGURING="false" RECONFIGURING="false"
db_get jitsi-meet/jvb-hostname db_get jitsi-meet/jvb-hostname
JVB_HOSTNAME_OLD=$RET JVB_HOSTNAME_OLD=$(echo "$RET" | xargs echo -n)
if [ -n "$RET" ] && [ ! "$JVB_HOSTNAME_OLD" = "$JVB_HOSTNAME" ] ; then if [ -n "$RET" ] && [ ! "$JVB_HOSTNAME_OLD" = "$JVB_HOSTNAME" ] ; then
RECONFIGURING="true" RECONFIGURING="true"
rm -f /etc/jitsi/meet/$JVB_HOSTNAME_OLD-config.js rm -f /etc/jitsi/meet/$JVB_HOSTNAME_OLD-config.js

View File

@ -33,7 +33,7 @@ case "$1" in
;; ;;
purge) purge)
db_get jitsi-meet/jvb-hostname db_get jitsi-meet/jvb-hostname
JVB_HOSTNAME=$RET JVB_HOSTNAME=$(echo "$RET" | xargs echo -n)
if [ -n "$RET" ]; then if [ -n "$RET" ]; then
rm -f /etc/jitsi/meet/$JVB_HOSTNAME-config.js rm -f /etc/jitsi/meet/$JVB_HOSTNAME-config.js
rm -f /etc/nginx/sites-available/$JVB_HOSTNAME.conf rm -f /etc/nginx/sites-available/$JVB_HOSTNAME.conf