diff --git a/scripts/_common.sh b/scripts/_common.sh index 26090dc..ed308bc 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,6 +1,7 @@ # common.sh ROCKETCHAT_VERSION=0.57.2 +ROCKETCHAT_SHASUM=ca43b8d3487d0c8cd82dae5a4f66ef89c9ad7c202c67ff79096bbad696da6a07 NODE_VERSION=4.7.1 waitforservice() { diff --git a/scripts/install b/scripts/install index 63e9996..e5935e0 100644 --- a/scripts/install +++ b/scripts/install @@ -94,6 +94,11 @@ sudo cp ../conf/nginx.conf "$nginx_conf" # download and extract rocketchat echo "Downloading rocket.chat-$ROCKETCHAT_VERSION.gtar from https://rocket.chat/releases/${ROCKETCHAT_VERSION}/download." sudo curl -s -L -o $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar "https://rocket.chat/releases/${ROCKETCHAT_VERSION}/download" +SHA_DOWNLOAD=$(sha256sum $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar | grep -o "^[a-f0-9]*") +if [[ ! "$SHA_DOWNLOAD" == "$ROCKETCHAT_SHASUM" ]]; then + ynh_die "The sha256sum does not match the configured one" +fi + sudo tar -xzf $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar -C $final_path --strip-components=1 bundle sudo rm $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar