X-Git-Url: http://git.samba.org/?p=samba.git;a=blobdiff_plain;f=ctdb%2Fconfig%2Fctdbd_wrapper;h=34827eaaa29c6c7379e01eea8353523fa31c93eb;hp=a3c9db3ea8fbcae2363befbabbaf5402ebc02328;hb=87284da7a28172b40504eb50510a8b57da6692a6;hpb=b184761829dc291cbed696084c271316dca79607 diff --git a/ctdb/config/ctdbd_wrapper b/ctdb/config/ctdbd_wrapper index a3c9db3ea8f..34827eaaa29 100755 --- a/ctdb/config/ctdbd_wrapper +++ b/ctdb/config/ctdbd_wrapper @@ -20,103 +20,14 @@ fi . "${CTDB_BASE}/functions" -loadconfig +load_system_config "ctdb" ctdbd="${CTDBD:-/usr/local/sbin/ctdbd}" ############################################################ -# Only the nested function references its arguments -# shellcheck disable=SC2120 -build_ctdb_options () -{ - maybe_set () - { - _section="$1" - _key="$2" - _val="$3" - _check="$4" - - # If the given variable isn't set then do nothing - [ -n "$_val" ] || return - # If a value is required for the variable and it doesn't - # match, then do nothing - if [ -n "$_check" -a "$_check" != "$_val" ] ; then - return - fi - - # Configuration file handling needs true/false, not yes/no - case "$_val" in - yes) _val="true" ;; - no) _val="false" ;; - esac - - if grep -q "^\\[${_section}\\]\\$" "$_conf_file" ; then - # Section already exists... - # Must escape leading TAB or sed eats it - sed -i -e "/\\[${_section}\\]/a\ -\\ ${_key} = ${_val} -" "${_conf_file}" - else - # Section does not exist and needs to be created... - # Note literal TAB for indentation in here document - cat >>"${_conf_file}" <