mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-19 21:03:19 -07:00
Allow script to run with sudo
Load .plexupdate file from the user's home folder, instead of /root/, when script is executed using sudo. Fixes #38
This commit is contained in:
parent
2080649d80
commit
43a8e41e5a
1 changed files with 6 additions and 2 deletions
|
@ -65,8 +65,12 @@ if [ $? -eq 127 ]; then
|
|||
fi
|
||||
|
||||
# Load settings from config file if it exists
|
||||
if [ -f ~/.plexupdate ]; then
|
||||
source ~/.plexupdate
|
||||
CONFIG_FILE="${HOME}/.plexupdate"
|
||||
if [[ ! -z ${SUDO_USER} ]] ; then
|
||||
CONFIG_FILE="`eval echo ~${SUDO_USER}`/.plexupdate"
|
||||
fi
|
||||
if [ -f ${CONFIG_FILE} ]; then
|
||||
source ${CONFIG_FILE}
|
||||
fi
|
||||
|
||||
if [ "${RELEASE}" = "64-bit" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue