Method: Rbeapi::Api::System#set_banner

Defined in:
lib/rbeapi/api/system.rb

#set_banner(banner_type, opts = {}) ⇒ Boolean

Configures system banners.

Parameters:

  • banner_type (String)

    Banner to be changed (likely either login or motd).

  • opts (Hash) (defaults to: {})

    The configuration parameters.

Options Hash (opts):

  • value (string)

    The value to set for the banner.

  • enable (Boolean)

    If false then the command is negated. Default is true.

  • default (Boolean)

    If true configure the command using the default keyword. Default is false.

Returns:

  • (Boolean)

    Returns true if the command completed successfully.



213
214
215
216
217
218
219
220
221
222
223
# File 'lib/rbeapi/api/system.rb', line 213

def set_banner(banner_type, opts = {})
  value = opts[:value]
  cmd_string = "banner #{banner_type}"
  if value
    value += "\n" if value[-1, 1] != "\n"
    cmd = [{ cmd: cmd_string, input: value }]
  else
    cmd = command_builder(cmd_string, opts)
  end
  configure(cmd)
end