Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
set -Eeuo pipefail
LOGFILE="/setup-$(date +%Y%m%d%H%M%S).log"
exec > >(tee -a "$LOGFILE") 2>&1
gray_run() { ( "$@" ) 2>&1 | while IFS= read -r line; do printf "\033[0;90m%s\033[0m\n" "$line"; done; }
log() { printf "\033[1;32m[+] %s\033[0m\n" "$*"; }
warn() { printf "\033[1;33m[!] %s\033[0m\n" "$*"; }
err() { printf "\033[1;31m[×] %s\033[0m\n" "$*" >&2; }