#!/bin/bash # Message function say() { echo "TALER: " "$@" } # Check user if the user is root function check_user() { if [ "$(whoami)" != "root" ]; then say "Please run this script as root" exit 1 fi } # Set DISTRO to the detected distro or return non-zero # status if distro not supported. function detect_distro() { unset DISTRO # shellcheck disable=SC2034 uname -a | grep Ubuntu >/dev/null && DISTRO=ubuntu && return 0 # shellcheck disable=SC2034 uname -a | grep Debian >/dev/null && DISTRO=debian && return 0 echo "Unsupported distro, should be either ubuntu or debian" >&2 return 1 }