config() { NEW="$1" OLD="$(dirname $NEW)/$(basename $NEW .new)" # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy rm $NEW fi # Otherwise, we leave the .new copy for the admin to consider... } # One-time migration from Redis # if [ -f etc/redis/redis.conf ]; then [ -f run/php-fpm.pid ] && etc/rc.d/rc.redis stop echo "Migration from Redis to Valkey..." mv etc/redis/redis.conf etc/valkey/valkey.conf.redis rm etc/logrotate.d/redis chmod 644 etc/rc.d/rc.redis cp var/lib/redis/dump.rdb var/lib/valkey fi config etc/rc.d/rc.valkey.new config etc/valkey/valkey.conf.new config etc/valkey/sentinel.conf.new config etc/logrotate.d/valkey.new