source/code/plugins/agent_maintenance_script.rb
# Update omsadmin.conf with the specified variable's value
Update omsadmin.conf with the specified variable's value
Update omsadmin . conf with the specified variable ' s value
def update_config(var, val)
      if !File.exist?(@omsadmin_conf_path)
        return MISSING_CONFIG_FILE
      end
      old_text = File.read(@omsadmin_conf_path)
      new_text = old_text.sub(/^#{var}=.*\n/,"#{var}=#{val}\n")
      File.open(@omsadmin_conf_path, "w") { |file|
        file.puts(new_text)
      }
    end
def update_config ( var , val ) if ! File . exist? ( @omsadmin_conf_path ) return MISSING_CONFIG_FILE end old_text = File . read ( @omsadmin_conf_path ) new_text = old_text . sub ( / ^ #{ var } =.* \n / , "#{var}=#{val}\n" ) File . open ( @omsadmin_conf_path , "w" ) { | file | file . puts ( new_text ) } end
Update omsadmin.conf with the specified variable's value
Update omsadmin . conf with the specified variable ' s value
var
<not_specific>
val
<not_specific>