Skip to content
Snippets Groups Projects
Commit 2b1ca0eb authored by Dirk Sarpe's avatar Dirk Sarpe
Browse files

adapt rstudio version check to changed dl-website

parent c086fc55
No related branches found
No related tags found
No related merge requests found
...@@ -2,23 +2,23 @@ ...@@ -2,23 +2,23 @@
# check for new rstudio and download it if necessary # check for new rstudio and download it if necessary
set -e set -e
ubuntudlversion=trusty
rawstring=$(curl -s https://www.rstudio.com/products/rstudio/download-server/ |grep -o "wget.*amd64.deb") rawstring=$(curl -s https://rstudio.com/products/rstudio/download-server/debian-ubuntu/ |
grep -o -e "wget https:\/\/.*server\/${ubuntudlversion}.*\/rstudio-server-[0-9.]\+-amd64.deb")
prefix="$" prefix="$"
suffix="<br />" suffix="<br />"
noprefix=${rawstring#$prefix} noprefix=${rawstring#$prefix}
nosuffix=${noprefix%$suffix} nosuffix=${noprefix%$suffix}
dlcommand="$(echo $nosuffix -q -P /home/monitoring/)" dlcommand="$nosuffix -q -P /home/monitoring/"
cur_version=$(rstudio-server version) cur_version=$(rstudio-server version)
avail_version="$(echo $dlcommand | cut -d "-" -f 3)" avail_version=$(cut -d "-" -f 3 <<< "$dlcommand")
if [ "$avail_version" == "$cur_version" ] if [ "$avail_version" == "$cur_version" ]
then then
echo "RStudio up to date." echo "RStudio up to date."
else else
if [ ! -e /home/monitoring/rstudio-server-${avail_version}-amd64.deb ] if [ ! -e /home/monitoring/rstudio-server-"${avail_version}"-amd64.deb ]
then then
eval $dlcommand eval "$dlcommand"
fi fi
echo "RStudio version $avail_version available (in use $cur_version)" echo "RStudio version $avail_version available (in use $cur_version)"
fi fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment