#!/bin/sh # HOW TO USE: # sh -c "$(curl -fsSL https://script.webb.page/server.sh)" # exit script if something fails set -e # disable "pending kernel upgrade" popup | https://askubuntu.com/a/1424249 sed -i "s/#\$nrconf{kernelhints} = -1;/\$nrconf{kernelhints} = -1;/g" /etc/needrestart/needrestart.conf # ignore "daemons using outdated libraries" popup | https://stackoverflow.com/a/73397110#comment131834051_73397970 sed -i "/#\$nrconf{restart} = 'i';/s/.*/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "+ Setting timezone to US Pacific… +" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "" ln -fs /usr/share/zoneinfo/US/Pacific /etc/localtime dpkg-reconfigure -f noninteractive tzdata echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "+ Updating and upgrading packages… +" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "" apt update && apt upgrade -y # TODO # figure out how to auto-accept defaults echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "+ Installing packages we like to use… +" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "" apt install eza unzip -y echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "+ Installing caddy… +" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "" apt install debian-keyring debian-archive-keyring apt-transport-https curl -y curl -1sLf "https://dl.cloudsmith.io/public/caddy/stable/gpg.key" | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg curl -1sLf "https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt" | tee /etc/apt/sources.list.d/caddy-stable.list apt update -y apt install caddy -y echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "+ Installing zsh/ohmyzsh… +" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "" apt install zsh -y sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended # make zsh default shell command -v zsh | tee -a /etc/shells chsh -s $(which zsh) $USER echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "+ Installing deno… +" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "" curl -fsSL https://deno.land/install.sh | sh echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "+ Installing bun… +" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "" curl -fsSL https://bun.sh/install | bash echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "+ Package cleanup +" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "" apt autoremove -y echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "+ Server setup complete! You should reboot now +" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo ""