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

add version checker for rstudio server

parent 02761860
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# 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")
prefix="$"
suffix="<br />"
noprefix=${rawstring#$prefix}
nosuffix=${noprefix%$suffix}
dlcommand="$(echo $nosuffix -q -P /home/monitoring/)"
cur_version=$(rstudio-server version)
avail_version="$(echo $dlcommand | cut -d "-" -f 3)"
if [ "$avail_version" == "$cur_version" ]
then
echo "RStudio up to date."
else
if [ ! -e /home/monitoring/rstudio-server-${avail_version}-amd64.deb ]
then
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.
Finish editing this message first!
Please register or to comment