Skip to content

Instantly share code, notes, and snippets.

@obarisk
Created October 14, 2018 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save obarisk/62f447cf30274be14bc1b62afd23583f to your computer and use it in GitHub Desktop.
Save obarisk/62f447cf30274be14bc1b62afd23583f to your computer and use it in GitHub Desktop.
update-shiny-server on ubuntu
#!/bin/bash
DISTRO="ubuntu"
DISTROCODE="14.04"
ARCH="x86_64"
HOST="https://download3.rstudio.org"
ShinyV=$(curl -s https://www.rstudio.com/products/shiny/download-server/ |\
grep 'Download RStudio Shiny Server' |\
sed 's/<[^>]*>//g' |\
sed 's/Download RStudio Shiny Server v//' |\
sed 's/ //g' |\
tr -d '[:space:]')
ShinyU="${HOST}/${DISTRO}-${DISTROCODE}/${ARCH}/shiny-server-${ShinyV}-amd64.deb"
InstallV=$(apt-cache policy shiny-server |\
grep Installed |\
sed 's/Installed: //g' |\
sed 's/ //g' |\
tr -d '[:space:]')
if [ "${ShinyV}" != "${InstallV}" ]; then
wget $ShinyU
sudo gdebi "shiny-server-${ShinyV}-amd64.deb"
rm "shiny-server-${ShinyV}-amd64.deb"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment