Fix /etc/motd generation

This commit is contained in:
2022-01-26 15:38:51 -05:00
parent 103b0c682b
commit 2efeb4e887
4 changed files with 16 additions and 13 deletions

View File

@@ -29,15 +29,16 @@ else
exit 1
fi
ask_ok "Update R to version $1 and RStudio to version $2?" || exit $?
ask_ok "Update R to version $1 and RStudio to version $2?" || exit
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-${2}-x86_64.rpm" \
"https://download1.rstudio.org/desktop/centos7/x86_64/rstudio-${2}-x86_64.rpm"
desktop_file="/usr/share/applications/rstudio-R4.desktop"
[[ -f "$desktop_file" ]] && \
sed -i "s|/opt/R/.*/bin/R|/opt/R/$1/bin/R|" "$desktop_file"
exit $?
if 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-${2}-x86_64.rpm" \
"https://download1.rstudio.org/desktop/centos7/x86_64/rstudio-${2}-x86_64.rpm" &&
desktop_file="/usr/share/applications/rstudio-R4.desktop" &&
[[ -f "$desktop_file" ]] && sed -i "s|/opt/R/.*/bin/R|/opt/R/$1/bin/R|" "$desktop_file"; then
echo "Successfully updated R and RStudio"
exit 0
else
echo "R and RStudio update failed!"
exit 1
fi