Variable checks in case populated in conf file

This commit is contained in:
Richard Goodwin
2018-10-26 07:53:42 -05:00
parent d3f130e7c6
commit 11b3f510a5

View File

@@ -1,12 +1,10 @@
#!/bin/bash -eu #!/bin/bash -eu
USER_ENABLED_PUSHOVER=false USER_ENABLED_PUSHOVER=${USER_ENABLED_PUSHOVER:-false}
SETUP_LOGFILE=/boot/teslausb-headless-setup.log SETUP_LOGFILE=/boot/teslausb-headless-setup.log
REPO=${REPO:-cimryan} REPO=${REPO:-cimryan}
BRANCH=${BRANCH:-master} BRANCH=${BRANCH:-master}
HEADLESS_SETUP=${HEADLESS_SETUP:-false} HEADLESS_SETUP=${HEADLESS_SETUP:-false}
REPO=rtgoodwin
BRANCH=headless-patch
if ! [ $(id -u) = 0 ] if ! [ $(id -u) = 0 ]
@@ -17,12 +15,19 @@ fi
function setup_progress () { function setup_progress () {
if [ $HEADLESS_SETUP = "true" ] if [ $HEADLESS_SETUP = "true" ]
then
echo "$( date ) : $1" >> "$SETUP_LOGFILE" echo "$( date ) : $1" >> "$SETUP_LOGFILE"
else
echo $1
fi fi
echo $1
} }
function headless_populate_variables () {
# Pull in the conf file variables to make avail to this script and subscripts
if [ -e /boot/teslausb_setup_variables.conf ] && [ $HEADLESS_SETUP = "true" ]
then
source /boot/teslausb_setup_variables.conf
fi
}
function headless_mark_setup_failed () { function headless_mark_setup_failed () {
setup_log "ERROR: Setup Failed." setup_log "ERROR: Setup Failed."