mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-19 12:59:40 -07:00
Read /etc/plexupdate.conf before other configs, if available
This commit is contained in:
parent
7de3c8d758
commit
f3242f7ae3
1 changed files with 10 additions and 4 deletions
|
@ -268,7 +268,13 @@ if [ ! -z "${CONFIGFILE}" ]; then
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Load settings from config file if it exists
|
# Load settings from config file if it exists
|
||||||
# Also, respect SUDO_USER and try that first
|
if [ -f /etc/plexupdate.conf ]; then
|
||||||
|
info "Reading configuration in: /etc/plexupdate.conf"
|
||||||
|
CONFIGFILE=/etc/plexupdate.conf
|
||||||
|
source /etc/plexupdate.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for a SUDO_USER config
|
||||||
if [ ! -z "${SUDO_USER}" ]; then
|
if [ ! -z "${SUDO_USER}" ]; then
|
||||||
# Make sure nothing bad comes from this (since we use eval)
|
# Make sure nothing bad comes from this (since we use eval)
|
||||||
ERROR=0
|
ERROR=0
|
||||||
|
@ -292,18 +298,18 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "${CONFIGDIR}" -a -f "${CONFIGDIR}/.plexupdate" ]; then
|
if [ ! -z "${CONFIGDIR}" -a -f "${CONFIGDIR}/.plexupdate" ]; then
|
||||||
info "Using \"${SUDO_USER}\" configuration: ${CONFIGDIR}/.plexupdate" #>/dev/null
|
info "Reading \"${SUDO_USER}\" configuration in: ${CONFIGDIR}/.plexupdate"
|
||||||
CONFIGFILE="${CONFIGDIR}/.plexupdate"
|
CONFIGFILE="${CONFIGDIR}/.plexupdate"
|
||||||
source "${CONFIGDIR}/.plexupdate"
|
source "${CONFIGDIR}/.plexupdate"
|
||||||
elif [ -f ~/.plexupdate ]; then
|
elif [ -f ~/.plexupdate ]; then
|
||||||
# Fallback for compatibility
|
# Fallback for compatibility
|
||||||
info "Using \"${SUDO_USER}\" configuration: ${HOME}/.plexupdate" #>/dev/null
|
info "Reading \"${SUDO_USER}\" configuration in: ${HOME}/.plexupdate"
|
||||||
CONFIGFILE="${HOME}/.plexupdate" # tilde expansion won't happen later.
|
CONFIGFILE="${HOME}/.plexupdate" # tilde expansion won't happen later.
|
||||||
source ~/.plexupdate
|
source ~/.plexupdate
|
||||||
fi
|
fi
|
||||||
elif [ -f ~/.plexupdate ]; then
|
elif [ -f ~/.plexupdate ]; then
|
||||||
# Fallback for compatibility
|
# Fallback for compatibility
|
||||||
info "Using configuration: ${HOME}/.plexupdate" #>/dev/null
|
info "Reading configuration in: ${HOME}/.plexupdate"
|
||||||
CONFIGFILE="${HOME}/.plexupdate"
|
CONFIGFILE="${HOME}/.plexupdate"
|
||||||
source ~/.plexupdate
|
source ~/.plexupdate
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue