Browse Source

Fixes errors in postinst, not using our template and error about grep test.

j8
Damian Minkov 11 years ago
parent
commit
bd543c4b75
1 changed files with 13 additions and 3 deletions
  1. 13
    3
      debian/jitsi-meet-prosody.postinst

+ 13
- 3
debian/jitsi-meet-prosody.postinst View File

@@ -1,4 +1,4 @@
1
-#!/bin/sh
1
+#!/bin/bash
2 2
 # postinst script for jitsi-meet-prosody
3 3
 #
4 4
 # see: dh_installdeb(1)
@@ -24,14 +24,24 @@ case "$1" in
24 24
         . /etc/default/jitsi-videobridge
25 25
 
26 26
         PROSODY_CONFIG_PRESENT="true"
27
+        # if there is no prosody config extract our template
27 28
         if [ ! -f /etc/prosody/prosody.cfg.lua ]; then
28 29
             PROSODY_CONFIG_PRESENT="false"
29 30
             gunzip -c /usr/share/doc/jitsi-meet-prosody/prosody.cfg.lua-jvb.example.gz > /etc/prosody/prosody.cfg.lua
30 31
         fi
31 32
 
32
-        if [ ! grep "VirtualHost \"$JVB_HOSTNAME\"" /etc/prosody/prosody.cfg.lua > /dev/null ]; then
33
+        # if there is no config for our domain, lets create it
34
+        if ! grep -q "VirtualHost \"$JVB_HOSTNAME\"" /etc/prosody/prosody.cfg.lua; then
35
+
36
+            # if its not our template, save the original and extract our template
37
+            if ! grep -q "VirtualHost \"jitmeet.example.com\"" /etc/prosody/prosody.cfg.lua; then
38
+                PROSODY_CONFIG_PRESENT="false"
39
+                cp /etc/prosody/prosody.cfg.lua /etc/prosody/prosody.cfg.lua.orig
40
+                gunzip -c /usr/share/doc/jitsi-meet-prosody/prosody.cfg.lua-jvb.example.gz > /etc/prosody/prosody.cfg.lua
41
+            fi
42
+
33 43
             if [ "PROSODY_CONFIG_PRESENT" = "true" ]; then
34
-                mv /etc/prosody/prosody.cfg.lua /etc/prosody/prosody.cfg.lua.orig
44
+                cp /etc/prosody/prosody.cfg.lua /etc/prosody/prosody.cfg.lua.orig
35 45
             fi
36 46
             sed -i "s/jitmeet.example.com/$JVB_HOSTNAME/g" /etc/prosody/prosody.cfg.lua
37 47
             sed -i "s/jitmeetSecret/$JVB_SECRET/g" /etc/prosody/prosody.cfg.lua

Loading…
Cancel
Save