#!/bin/bash # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ set -euxo pipefail CODENAME=$(lsb_release --short --codename) if [ "$(id -u)" != "0" ]; then SUDO="sudo" else SUDO="" fi # Script to install Tor echo "deb http://deb.torproject.org/torproject.org ${CODENAME} main" | ${SUDO} tee -a /etc/apt/sources.list echo "deb-src http://deb.torproject.org/torproject.org ${CODENAME} main" | ${SUDO} tee -a /etc/apt/sources.list # # Install Tor repo signing key ${SUDO} apt-key add - <