mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-14 02:26:56 -07:00
Test run should run with sudo if installed as root (#278)
* Test run should run with sudo if installed as root. Fixes #277 * Make cron logic in installer more readable * Style fix for conditional * Be sure CRON option is actually set
This commit is contained in:
parent
7231223070
commit
4d13feb6b1
1 changed files with 7 additions and 2 deletions
|
@ -236,11 +236,16 @@ configure_cron() {
|
|||
return 1
|
||||
fi
|
||||
|
||||
[ -f "$CONFIGCRON" ] && source "$CONFIGCRON"
|
||||
if [ -f "$CONFIGCRON" ]; then
|
||||
#this is redundant since null is evaluated as yes anyway, but including for readability
|
||||
CRON=yes
|
||||
source "$CONFIGCRON"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo -n "Would you like to set up automatic daily updates for Plex? "
|
||||
if yesno $CRON; then
|
||||
CRON=yes
|
||||
if [ $(sudo find -L "${FULL_PATH}" -perm /002 -or -not -uid 0 -or -not -gid 0 | wc -l) -ne 0 ]; then
|
||||
echo
|
||||
echo "WARNING: For security reasons, plexupdate needs to be installed as root in order to run automatically. In order to finish setting up automatic updates, we will change the ownership of '${FULL_PATH}' to root:root."
|
||||
|
@ -354,7 +359,7 @@ if yesno; then
|
|||
if wget --show-progress -V &> /dev/null; then
|
||||
PROGRESS_OPT="-P"
|
||||
fi
|
||||
if [ "$AUTOINSTALL" == "yes" ]; then
|
||||
if [ "$AUTOINSTALL" == "yes" -o "$CRON" == "yes" ]; then
|
||||
sudo -E "$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE"
|
||||
else
|
||||
"$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue