set permission for /var/cache if it did not exist before

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>
This commit is contained in:
pvogt09 2020-03-23 14:35:20 +01:00
parent f7e80e9ce7
commit eef312d9cb
2 changed files with 7 additions and 0 deletions

View file

@ -1431,7 +1431,12 @@ installConfigs() {
# Make the directories if they do not exist and set the owners # Make the directories if they do not exist and set the owners
mkdir -p /run/lighttpd mkdir -p /run/lighttpd
chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /run/lighttpd chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /run/lighttpd
local varcache=$(test -d /var/cache; echo $?)
mkdir -p /var/cache/lighttpd/compress mkdir -p /var/cache/lighttpd/compress
if [[ ! "${varcache}" -eq 0 ]]; then
chmod a+rx /var/cache
fi
chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/cache/lighttpd
chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/cache/lighttpd/compress chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/cache/lighttpd/compress
mkdir -p /var/cache/lighttpd/uploads mkdir -p /var/cache/lighttpd/uploads
chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/cache/lighttpd/uploads chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/cache/lighttpd/uploads

View file

@ -226,6 +226,8 @@ def test_installPihole_fresh_install_readableBlockpage(Pihole, test_webpage):
setup_var_file = 'cat <<EOF> /etc/pihole/setupVars.conf\n' setup_var_file = 'cat <<EOF> /etc/pihole/setupVars.conf\n'
for k, v in SETUPVARS.items(): for k, v in SETUPVARS.items():
setup_var_file += "{}={}\n".format(k, v) setup_var_file += "{}={}\n".format(k, v)
setup_var_file += "INSTALL_WEB_SERVER=true\n"
setup_var_file += "INSTALL_WEB_INTERFACE=true\n"
setup_var_file += "EOF\n" setup_var_file += "EOF\n"
Pihole.run(setup_var_file) Pihole.run(setup_var_file)
installWeb = Pihole.run(''' installWeb = Pihole.run('''