1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rocketchat_ynh.git synced 2024-09-03 20:16:25 +02:00

Added sha256sum check to downloaded archive

This commit is contained in:
Felix Knecht 2017-07-24 15:48:53 +02:00 committed by Selamanse
parent b5e92d7197
commit f9b5515296
2 changed files with 6 additions and 0 deletions

View file

@ -1,6 +1,7 @@
# common.sh
ROCKETCHAT_VERSION=0.57.2
ROCKETCHAT_SHASUM=ca43b8d3487d0c8cd82dae5a4f66ef89c9ad7c202c67ff79096bbad696da6a07
NODE_VERSION=4.7.1
waitforservice() {

View file

@ -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