#!/bin/bash #################################################################################################### #### author: SlickStack ############################################################################ #### link: https://slickstack.io ################################################################### #### mirror: http://mirrors.slickstack.io/bash/ss-perms-redis.txt ################################## #### path: /var/www/ss-perms-redis ################################################################# #### destination: n/a (not a boilerplate) ########################################################## #### purpose: Resets all file and user permissions across the entire Redis module ################## #### module version: Redis 5.0.x ################################################################### #### sourced by: ss-perms, ss-install-redis ######################################################## #### bash aliases: ss perms redis, ss perms object cache ########################################### #################################################################################################### ## include SlickStack configuration ## source /var/www/ss-config ## include SlickStack functions ## source /var/www/ss-functions #################################################################################################### #### SS-Perms-Redis: Message (Begin Script) ######################################################## #################################################################################################### ## this is a simple message that announces to the shell the purpose of this bash script ## ## it will only be noticed by sudo users who manually call ss core bash scripts ## ## echo message ## echo -e "${PURPLE}Running ss-perms-redis: Resets all file and user permissions across the entire Redis module... ${NOCOLOR}" sleep "$SLEEP_MESSAGE_BEGIN" #################################################################################################### #### SS-Perms-Redis: Reset Permissions (Redis) ##################################################### #################################################################################################### mkdir /var/run/redis if [ ! -f "/var/www/logs/redis.log" ]; then touch "/var/www/logs/redis.log"; fi chown redis:redis /var/www/logs/redis*.log* chmod 0644 /var/www/logs/redis*.log* ## 6755 should also work chown redis:redis /var/run/redis &> /dev/null chown redis:redis /etc/redis/redis.conf &> /dev/null chown redis:redis /var/www/logs/redis.log chown redis:redis /etc/redis/redis.conf chown redis:redis /var/run/redis chmod 6775 /var/www/logs/redis.log chmod 775 /etc/redis/redis.conf chmod 775 /var/run/redis #################################################################################################### #### SS-Perms-Redis: Touch Timestamp File (End Script) ############################################# #################################################################################################### ## this is a dummy timestamp file that will remember the last time this script was run ## ## it can be useful for developer reference and is sometimes used by SlickStack ## ## script timestamp ## touch /var/www/meta/.timestamp-ss-perms-redis #################################################################################################### #### SlickStack: External References Used To Improve This Script (Thanks, Interwebz) ############### #################################################################################################### ## Ref: ## SS_EOF