Add datacenter node setup scripts (#5517)

automerge
This commit is contained in:
TristanDebrunner
2019-08-22 13:19:49 -06:00
committed by Grimes
parent 63d62c33c6
commit 51cf559ce1
12 changed files with 273 additions and 0 deletions

View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
# We need root access, but also appropriate envvar values. Require scripts to
# run with sudo as a normal user
ensure_env() {
RC=false
[ $EUID -eq 0 ] && [ -n "$SUDO_USER" ] && [ "$SUDO_USER" != "root" ] && RC=true
if $RC; then
export SETUP_USER="$SUDO_USER"
export SETUP_HOME="$HOME"
else
echo "Please run \"$0\" via sudo as a normal user"
fi
$RC
}