diff --git a/ubuntu.sh b/ubuntu.sh index 27daef484ba44f16b28877ae6112bc6a36eff130..98fadb8a3b879a7fd62fcf33d6b030efd1a8668f 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