From a24deedb034ba1a578c33ea309c2461bd4680393 Mon Sep 17 00:00:00 2001 From: Bryan Roessler Date: Sun, 2 Jan 2022 22:31:14 -0500 Subject: [PATCH] Improve script-system-update-r --- README.md | 9 +++++++-- script-system-update-r | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5ec9b95f..f508497f 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,8 @@ Last updated: 2021-10-22 - [Allow access to the samba share within the Windows VM (Windows bug workaround)](#allow-access-to-the-samba-share-within-the-windows-vm-windows-bug-workaround) - [Make an existing Windows 10 account user an administrator](#make-an-existing-windows-10-account-user-an-administrator) - [Creating more VM disk space](#creating-more-vm-disk-space) - - [Updating all software](#updating-all-software) + - [Updating system software](#updating-system-software) + - [Updating RStudio and RStudio Server](#updating-rstudio-and-rstudio-server) - [Scheduling a restart](#scheduling-a-restart) - [Adding a drive](#adding-a-drive) - [Logging](#logging) @@ -297,12 +298,16 @@ Once configured, the user will no longer need to enter their password to access - Add 20 GBs of space to the Windows VM: `sudo qemu-img resize /var/lib/libvirt/images/win10-5900.qcow2 +20G` - Add [gparted iso](/media/share/documentation) as boot device and expand working partition. -### Updating all software +### Updating system software - `script-system-update` - The server regularly installs security updates unattended - If the kernel, java, systemd, or other major components are updated, the system should be restarted. +### Updating RStudio and RStudio Server + + -`script-system-update-r` + ### Scheduling a restart - `script-system-scheduled-restart` *`OnCalendar`* diff --git a/script-system-update-r b/script-system-update-r index 9bba2ff2..24a00b6c 100755 --- a/script-system-update-r +++ b/script-system-update-r @@ -1,5 +1,6 @@ #!/usr/bin/env bash # Update the R binaries and RStudio-R4 application meny entry +# $1: Version number ex. '2021.09.1-372' # Copyright 2021 Bryan C. Roessler parent="${BASH_SOURCE[0]}" @@ -9,16 +10,24 @@ parent=${parent%/*} is_root -[[ $# -ne 1 ]] && echo "Missing R version argument." && exit 1 +if [[ $# -ne 1 ]]; then + echo "Missing R version argument." + echo "Example: '2021.09.1-372'" + exit 1 +fi ask_ok "RStudio-R4 to version $1?" || exit $? -sudo dnf install -y "https://cdn.rstudio.com/r/centos-7/pkgs/R-${1}-1-1.x86_64.rpm" +sudo dnf install -y "https://cdn.rstudio.com/r/centos-7/pkgs/R-${1}-1-1.x86_64.rpm" \ + "https://download2.rstudio.org/server/centos7/x86_64/rstudio-server-rhel-${1}-x86_64.rpm" -desktop_file="/usr/share/applications/rstudio-4.desktop" + + + +desktop_file="/usr/share/applications/rstudio-R4.desktop" [[ ! -f "$desktop_file" ]] && exit 1 -sed -i "s|/opt/R/.*/bin/R|/opt/R/$1/bin/R|" "$desktop_file" +sed -i "s|/opt/R/.*/bin/R|/opt/R/$1/bin/R|" "$desktop_file" exit $? \ No newline at end of file