#! /bin/bash # Rocky9 compatible . /usr/src/k_framework/main.sh SCRIPT_NAME="SVN store-plaintext-passwords disable" VERSION="1.1.1" k_start if [[ -e /root/.subversion/servers ]]; then if grep -A20 -F '[global]' /root/.subversion/servers | grep -q '^store-plaintext-passwords\s*=\s*yes'; then sed -Ei '/^[[:space:]]*store-plaintext-passwords/d' /root/.subversion/servers fi if ! grep -A20 -F '[global]' /root/.subversion/servers | grep -q '^store-plaintext-passwords=no'; then sed -Ei '/^[[:space:]]*store-plaintext-passwords/d' /root/.subversion/servers sed -i "s|\[global\]|\[global\]\nstore-plaintext-passwords=no|" /root/.subversion/servers fi if grep -A20 -F '[global]' /root/.subversion/servers | grep -q '^store-plaintext-passwords=no'; then report "store-plaintext-passwords set to no in svn config /root/.subversion/servers" 0 else report "Unable to set store-plaintext-passwords to no in svn config /root/.subversion/servers" 1 fi fi k_exit $EXIT_CODE