#!/bin/bash
# usage $0 [MAIL_HOST]
+# setup things which involve being the primary host or not
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
-# setup things which involve being the primary host or not
+
+if [[ ! $SUDO_USER || $EUID == 0 ]]; then
+ echo "$0: error: requires running as nonroot or sudo"
+ exit 1
+fi
if [[ $1 ]]; then
new_host=$1