From b9b61d1462de446a335ba038d9bbea730f46e740 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sun, 28 Jul 2024 19:24:07 +0800 Subject: [PATCH] update --- plugins/fail2ban/{config => conf}/redis.conf | 0 ...redis.service.tpl => fail2ban.service.tpl} | 0 plugins/fail2ban/init.d/redis.tpl | 77 ------------------- 3 files changed, 77 deletions(-) rename plugins/fail2ban/{config => conf}/redis.conf (100%) rename plugins/fail2ban/init.d/{redis.service.tpl => fail2ban.service.tpl} (100%) delete mode 100644 plugins/fail2ban/init.d/redis.tpl diff --git a/plugins/fail2ban/config/redis.conf b/plugins/fail2ban/conf/redis.conf similarity index 100% rename from plugins/fail2ban/config/redis.conf rename to plugins/fail2ban/conf/redis.conf diff --git a/plugins/fail2ban/init.d/redis.service.tpl b/plugins/fail2ban/init.d/fail2ban.service.tpl similarity index 100% rename from plugins/fail2ban/init.d/redis.service.tpl rename to plugins/fail2ban/init.d/fail2ban.service.tpl diff --git a/plugins/fail2ban/init.d/redis.tpl b/plugins/fail2ban/init.d/redis.tpl deleted file mode 100644 index fb4f76e46..000000000 --- a/plugins/fail2ban/init.d/redis.tpl +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/sh -# chkconfig: 2345 55 25 -# description: Redis Service - -### BEGIN INIT INFO -# Provides: Redis -# Required-Start: $all -# Required-Stop: $all -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: starts Redis -# Description: starts the MDW-Web -### END INIT INFO - -# Simple Redis init.d script conceived to work on Linux systems -# as it does use of the /proc filesystem. - -CONF="{$SERVER_PATH}/redis/redis.conf" -REDISPORT=$(cat $CONF |grep port|grep -v '#'|awk '{print $2}') -REDISPASS=$(cat $CONF |grep requirepass|grep -v '#'|awk '{print $2}') -if [ "$REDISPASS" != "" ];then - REDISPASS=" -a $REDISPASS" -fi -EXEC={$SERVER_PATH}/redis/bin/redis-server -CLIEXEC="{$SERVER_PATH}/redis/bin/redis-cli -p $REDISPORT$REDISPASS" -PIDFILE={$SERVER_PATH}/redis/redis.pid - -echo $REDISPASS -echo $REDISPORT -echo $CLIEXEC - -mkdir -p {$SERVER_PATH}/redis/data - -redis_start(){ - if [ -f $PIDFILE ];then - kill -9 `cat $PIDFILE` - fi - - echo "Starting Redis server..." - nohup $EXEC $CONF >> {$SERVER_PATH}/redis/logs.pl 2>&1 & -} -redis_stop(){ - if [ ! -f $PIDFILE ] - then - echo "$PIDFILE does not exist, process is not running" - else - PID=$(cat $PIDFILE) - echo "Stopping ..." - $CLIEXEC shutdown save 2>/dev/null - while [ -x /proc/${PID} ] - do - echo "Waiting for Redis to shutdown ..." - sleep 1 - done - echo "Redis stopped" - rm -rf $PIDFILE - fi -} - - -case "$1" in - start) - redis_start - ;; - stop) - redis_stop - ;; - restart|reload) - redis_stop - sleep 0.3 - redis_start - ;; - *) - echo "Please use start or stop as first argument" - ;; -esac -