X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=primary-setup;h=30c4222a7bc9c3cdfb6885546a147c4b8225438f;hb=50e3ebaf4941651899a3b52b5245052c3f4ed725;hp=22ec48eb9c1b8539895a3c36d9fd6cabb5d27c7c;hpb=f7eaad64a7c5f3bc851f146e1f258d34f398a7d7;p=distro-setup diff --git a/primary-setup b/primary-setup index 22ec48e..30c4222 100755 --- a/primary-setup +++ b/primary-setup @@ -1,11 +1,16 @@ #!/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 @@ -33,6 +38,6 @@ else # done fi -mail-setup +/a/exe/mail-setup exit 0 :