1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 14:58:08 +00:00

Shellchecker

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
Dan Schaper 2021-06-20 11:19:19 -07:00
parent 7df22cd8e0
commit 4f660966d0
No known key found for this signature in database
GPG Key ID: 6055EE2AD4004FC0

View File

@ -1954,7 +1954,7 @@ installLogrotate() {
return 2 return 2
fi fi
# Copy the file over from the local repo # Copy the file over from the local repo
install -D -m 644 -T ${PI_HOLE_LOCAL_REPO}/advanced/Templates/logrotate ${target} install -D -m 644 -T "${PI_HOLE_LOCAL_REPO}"/advanced/Templates/logrotate ${target}
# Different operating systems have different user / group # Different operating systems have different user / group
# settings for logrotate that makes it impossible to create # settings for logrotate that makes it impossible to create
# a static logrotate file that will work with e.g. # a static logrotate file that will work with e.g.
@ -1963,7 +1963,7 @@ installLogrotate() {
# the local properties of the /var/log directory # the local properties of the /var/log directory
logusergroup="$(stat -c '%U %G' /var/log)" logusergroup="$(stat -c '%U %G' /var/log)"
# If there is a usergroup for log rotation, # If there is a usergroup for log rotation,
if [[ ! -z "${logusergroup}" ]]; then if [[ -n "${logusergroup}" ]]; then
# replace the line in the logrotate script with that usergroup. # replace the line in the logrotate script with that usergroup.
sed -i "s/# su #/su ${logusergroup}/g;" ${target} sed -i "s/# su #/su ${logusergroup}/g;" ${target}
fi fi