#!/bin/bash # exit when any command fails set -e # keep track of the last executed command trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG # echo an error message before exiting trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT rstudio-server offline [ ! -d "/tmp/install" ] && mkdir /tmp/install cd /tmp/install wget https://download2.rstudio.org/server/jammy/amd64/rstudio-server-2024.04.1-748-amd64.deb sudo gdebi rstudio-server-2024.04.1-748-amd64.deb rstudio-server online