From 1ba75daedd7d50f075cb8ea5fcefa968b04d8114 Mon Sep 17 00:00:00 2001
From: tamaina <tamaina@hotmail.co.jp>
Date: Thu, 19 Aug 2021 12:00:12 +0900
Subject: [PATCH] fix

---
 ubuntu.sh | 47 ++++++++++++++++++++++-------------------------
 1 file changed, 22 insertions(+), 25 deletions(-)

diff --git a/ubuntu.sh b/ubuntu.sh
index 27daef4..98fadb8 100644
--- a/ubuntu.sh
+++ b/ubuntu.sh
@@ -692,36 +692,33 @@ if [ $method != "systemd" ]; then
 		systemctl restart postgresql;
 	fi
 	#endregion
+fi
+#endregion
 
-	#region modify redis conf
-	if $redis_local; then
-		tput setaf 3;
-		echo "Process: modify redis confs;"
-		tput setaf 7;
+#region modify redis conf
+if $redis_local; then
+	tput setaf 3;
+	echo "Process: modify redis confs;"
+	tput setaf 7;
+	if [ -f /etc/redis/redis.conf ]; then
+		echo "requirepass $redis_pass" > /etc/redis/misskey.conf
+		$method != "systemd" && echo "bind $docker_host_ip" >> /etc/redis/misskey.conf
 
-		if [ -f /etc/redis/redis.conf ]; then
-			cat > /etc/redis/docker.conf <<-_EOF
-			bind $docker_host_ip
-			requirepass $redis_pass
-			_EOF
-			if ! grep "include /etc/redis/docker.conf" /etc/redis/redis.conf; then
-				echo "include /etc/redis/docker.conf" >> /etc/redis/redis.conf;
-			else
-				echo "	skip"
-			fi
+		if ! grep "include /etc/redis/misskey.conf" /etc/redis/redis.conf; then
+			echo "include /etc/redis/misskey.conf" >> /etc/redis/redis.conf;
 		else
-			echo "Couldn't find /etc/redis/redis.conf."
-			echo "Please modify redis config like following in another shell."
-			echo ""
-			echo "bind $docker_host_ip"
-			echo "requirepass $redis_pass"
-			echo ""
-			read -r -p "Press Enter key to continue> "
+			echo "	skip"
 		fi
-
-		systemctl restart redis-server;
+	else
+		echo "Couldn't find /etc/redis/redis.conf."
+		echo "Please modify redis config in another shell like following."
+		echo ""
+		$method != "systemd" && echo "requirepass $redis_pass"
+		echo "bind $docker_host_ip"
+		echo ""
+		read -r -p "Press Enter key to continue> "
 	fi
-#endregion
+	systemctl restart redis-server;
 fi
 #endregion
 
-- 
GitLab