iankelling.org
/
git
/
distro-setup
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changes for buster linode
[distro-setup]
/
primary-setup
diff --git
a/primary-setup
b/primary-setup
index 22ec48eb9c1b8539895a3c36d9fd6cabb5d27c7c..d6c0ed9ec4cf8ea43d64d2312fe0f50a46b23532 100755
(executable)
--- a/
primary-setup
+++ b/
primary-setup
@@
-1,11
+1,16
@@
#!/bin/bash
# usage $0 [MAIL_HOST]
#!/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
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 [[ $EUID == 0 && ! $SUDO_USER ]]; then
+ echo "$0: error: requires running as nonroot or sudo"
+ exit 1
+fi
if [[ $1 ]]; then
new_host=$1
if [[ $1 ]]; then
new_host=$1
@@
-13,7
+18,7
@@
if [[ $1 ]]; then
source /a/bin/bash_unpublished/source-state
fi
source /a/bin/bash_unpublished/source-state
fi
-if [[ $HOSTNAME ==
$MAIL_HOST
]]; then
+if [[ $HOSTNAME ==
"$MAIL_HOST"
]]; then
# arbtt disabled for now
#DISPLAY=:0 arbtt-capture --sample-rate=10 &
sudo systemctl start rss2email.timer
# arbtt disabled for now
#DISPLAY=:0 arbtt-capture --sample-rate=10 &
sudo systemctl start rss2email.timer
@@
-33,6
+38,6
@@
else
# done
fi
# done
fi
-mail-setup
+
/a/exe/
mail-setup
exit 0
:
exit 0
: