configure-mode.xml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <CLISH_MODULE xmlns="http://clish.sourceforge.net/XMLSchema"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://clish.sourceforge.net/XMLSchema
  5. http://clish.sourceforge.net/XMLSchema/clish.xsd">
  6. <!--=======================================================-->
  7. <VIEW name="configure-view"
  8. prompt="${SYSTEM_NAME}(config)# "
  9. restore="depth">
  10. <!------ Inheritance ------>
  11. <NAMESPACE ref="enable-view"
  12. prefix="do"
  13. help="true"
  14. completion="true"/>
  15. <COMMAND name="do"
  16. help="To run exec commands in config mode"/>
  17. <!------ Virtual commands ------>
  18. <COMMAND name="no"
  19. help="Negate a command or set its defaults"/>
  20. <COMMAND name="ip"
  21. help="Global IP configuration subcommands"/>
  22. <COMMAND name="no ip"
  23. help="Global IP configuration subcommands"/>
  24. <!------ Simple configuration mode commands ------>
  25. <COMMAND name="exit"
  26. help="Exit from configure mode"
  27. view="enable-view">
  28. </COMMAND>
  29. <COMMAND name="hostname"
  30. help="Set system's network name">
  31. <PARAM name="hostname"
  32. help="This system's network name"
  33. ptype="STRING"/>
  34. <CONFIG priority="0x1000"/>
  35. <ACTION>
  36. hostname "${hostname}"
  37. echo "${hostname}" > /etc/hostname
  38. sed -i "s|^127\.0\.0\.1.*$|127.0.0.1 localhost ${hostname}|" /etc/hosts
  39. </ACTION>
  40. </COMMAND>
  41. </VIEW>
  42. </CLISH_MODULE>