From a9b1c063e022564bc55a9780955248aef081a1b3 Mon Sep 17 00:00:00 2001 From: Sing Li Date: Sat, 24 Aug 2019 21:40:17 +0000 Subject: [PATCH] FINAL supported build 1.3.2 ; add RocketChat/Rocket.Chat#15120 and RocketChat/Rocket.Chat#13702 --- snapdir/snap/hooks/post-refresh | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/snapdir/snap/hooks/post-refresh b/snapdir/snap/hooks/post-refresh index 9a78145..f4172f2 100755 --- a/snapdir/snap/hooks/post-refresh +++ b/snapdir/snap/hooks/post-refresh @@ -1,16 +1,32 @@ #!/bin/bash # Initialize the CADDY_URL to a default -snapctl set caddy=disable +caddy="$(snapctl get caddy)" +if [ -z "$caddy" ]; then + snapctl set caddy=disable +fi # Initialize the PORT to a default -snapctl set port=3000 +port="$(snapctl get port)" +if [ -z "$port" ]; then + snapctl set port=3000 +fi # Initialize the MONGO_URL to a default -snapctl set mongo-url=mongodb://localhost:27017/parties +mongourl="$(snapctl get mongo-url)" +if [ -z "$mongourl" ]; then + snapctl set mongo-url=mongodb://localhost:27017/parties +fi # Initialize the MONGO_OPLOG_URL to a default -snapctl set mongo-oplog-url=mongodb://localhost:27017/local +mongooplogurl="$(snapctl get mongo-oplog-url)" +if [ -z "$mongooplogurl" ]; then + snapctl set mongo-oplog-url=mongodb://localhost:27017/local +fi # Initialize the protocol to a default -snapctl set https=disable +https="$(snapctl get https)" +if [ -z "$https" ]; then + snapctl set https=disable +fi +