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
2350a10bee
commit
1b771b4cef
1 changed files with 10 additions and 4 deletions
|
@ -274,7 +274,13 @@ if [ ! -z "${CONFIGFILE}" ]; then
|
|||
fi
|
||||
else
|
||||
# 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
|
||||
# Make sure nothing bad comes from this (since we use eval)
|
||||
ERROR=0
|
||||
|
@ -298,18 +304,18 @@ else
|
|||
fi
|
||||
|
||||
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"
|
||||
source "${CONFIGDIR}/.plexupdate"
|
||||
elif [ -f ~/.plexupdate ]; then
|
||||
# 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.
|
||||
source ~/.plexupdate
|
||||
fi
|
||||
elif [ -f ~/.plexupdate ]; then
|
||||
# Fallback for compatibility
|
||||
info "Using configuration: ${HOME}/.plexupdate" #>/dev/null
|
||||
info "Reading configuration in: ${HOME}/.plexupdate"
|
||||
CONFIGFILE="${HOME}/.plexupdate"
|
||||
source ~/.plexupdate
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue