diff --git a/install.sh b/install.sh index b9d788b3b94d..f1cc8026fa71 100755 --- a/install.sh +++ b/install.sh @@ -11,8 +11,20 @@ if [ "$1" == "development" ]; then fi cd $ROOTPATH -curl -fSL "https://s3.amazonaws.com/rocketchatbuild/rocket.chat-develop.tgz" -o rocket.chat.tgz -tar zxf rocket.chat.tgz && rm rocket.chat.tgz +gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 0E163286C20D07B9787EBE9FD7F9D0414FD08104 + +curl -SLf "https://releases.rocket.chat/latest/download/" -o rocket.chat.tgz +curl -SLf "https://releases.rocket.chat/latest/asc" -o rocket.chat.tgz.asc \ + +gpg --verify rocket.chat.tgz.asc +if [ $? -eq 0 ]; then + echo "Verified download integrity" +else + echo "Invalid file, download corrupted or incomplete" + exit 1 +fi + +tar zxf rocket.chat.tgz && rm rocket.chat.tgz rocket.chat.tgz.asc cd $ROOTPATH/bundle/programs/server npm install pm2 startOrRestart $ROOTPATH/current/$PM2FILE