Fix permissions issue

This commit is contained in:
Michael Stanclift 2020-05-26 22:44:30 -05:00
parent 4c9769dcef
commit f85a766319

View File

@ -154,7 +154,7 @@ function pull_gs {
echo -en "${STAT} ${MESSAGE}" echo -en "${STAT} ${MESSAGE}"
GRAVDB_RWE=$(namei -m ${PIHOLE_DIR}/${GRAVITY_FI} | grep -v f: | grep ${GRAVITY_FI} | awk '{print $1}') GRAVDB_RWE=$(namei -m ${PIHOLE_DIR}/${GRAVITY_FI} | grep -v f: | grep ${GRAVITY_FI} | awk '{print $1}')
if [ $GRAVDB_RWE = "-rw-r--r--" ] if [ $GRAVDB_RWE = "-rw-rw-r--" ]
then then
echo -e "\r${GOOD} ${MESSAGE}" echo -e "\r${GOOD} ${MESSAGE}"
else else
@ -165,7 +165,7 @@ function pull_gs {
MESSAGE="Setting Ownership on ${GRAVITY_FI}" MESSAGE="Setting Ownership on ${GRAVITY_FI}"
echo -en "${STAT} ${MESSAGE}" echo -en "${STAT} ${MESSAGE}"
sudo chmod 644 ${PIHOLE_DIR}/${GRAVITY_FI} >/dev/null 2>&1 sudo chmod 664 ${PIHOLE_DIR}/${GRAVITY_FI} >/dev/null 2>&1
error_validate error_validate
fi fi
@ -211,7 +211,7 @@ function push_gs {
MESSAGE="Setting Permissions on ${GRAVITY_FI}" MESSAGE="Setting Permissions on ${GRAVITY_FI}"
echo -en "${STAT} ${MESSAGE}" echo -en "${STAT} ${MESSAGE}"
${SSHPASSWORD} ssh ${REMOTE_USER}@${REMOTE_HOST} "sudo chmod 644 ${PIHOLE_DIR}/${GRAVITY_FI}" >/dev/null 2>&1 ${SSHPASSWORD} ssh ${REMOTE_USER}@${REMOTE_HOST} "sudo chmod 664 ${PIHOLE_DIR}/${GRAVITY_FI}" >/dev/null 2>&1
error_validate error_validate
MESSAGE="Setting Ownership on ${GRAVITY_FI}" MESSAGE="Setting Ownership on ${GRAVITY_FI}"