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

add version checker for shiny server

parent 8f14cd9b
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# check for new shiny version and download it if necessary
#set -x
#trap read debug
rawstring=$(curl -s https://rstudio.com/products/shiny/download-server/ubuntu/ |grep "wget.*amd64.deb")
prefix="<code>$ "
suffix="</code><br />"
noprefix=${rawstring#$prefix}
nosuffix=${noprefix%$suffix}
dlcommand="$nosuffix -q -P /home/monitoring/"
cur_version=$(shiny-server --version | head -n1 | cut -d "v" -f 3)
avail_version=$(cut -d "-" -f 4 <<< "$dlcommand")
if [ "$avail_version" != "$cur_version" ]
then
if [ ! -e /home/monitoring/shiny-server-"${avail_version}"-amd64.deb ]
then
eval "$dlcommand"
fi
echo "Shiny 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