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