Expand some scripted command arguments

This commit is contained in:
Alex Cabal 2024-11-25 14:08:14 -06:00
parent e6d4ea1ab6
commit 30f2925046
2 changed files with 8 additions and 6 deletions

View file

@ -22,8 +22,9 @@ if [ $# -ne 1 ]; then
usage
fi
# If this script is run by a user without sudo powers, they can be given permission to run this command by creating a file in sudoers.d with:
# MY_USERNAME ALL=(www-data) NOPASSWD: /usr/bin/env SCRIPT_FILENAME=/tmp/rebuild-cache.php REQUEST_METHOD=GET cgi-fcgi -bind -connect *
# If this script is run by a user without sudo powers, they can be given permission to run this command by creating a file in `sudoers.d` with:
#
# MY_USERNAME ALL=(www-data) NOPASSWD: /usr/bin/env SCRIPT_FILENAME=/tmp/rebuild-cache.php REQUEST_METHOD=GET cgi-fcgi -bind -connect *
type="$1"
@ -35,5 +36,5 @@ if [ "${type}" = "feeds" ]; then
echo "<?php require_once('Core.php'); Feed::RebuildFeedsCache(); ?>" > /tmp/rebuild-cache.php
fi
sudo -u www-data env SCRIPT_FILENAME=/tmp/rebuild-cache.php REQUEST_METHOD=GET cgi-fcgi -bind -connect "/run/php/standardebooks.org.sock" &> /dev/null
sudo --user=www-data env SCRIPT_FILENAME=/tmp/rebuild-cache.php REQUEST_METHOD=GET cgi-fcgi -bind -connect "/run/php/standardebooks.org.sock" &> /dev/null
rm /tmp/rebuild-cache.php