configure-mode.xml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. lock="false">
  29. </COMMAND>
  30. <COMMAND name="hostname"
  31. help="Set system's network name">
  32. <PARAM name="hostname"
  33. help="This system's network name"
  34. ptype="STRING"/>
  35. <CONFIG priority="0x1000"/>
  36. <ACTION>
  37. hostname "${hostname}"
  38. echo "${hostname}" > /etc/hostname
  39. sed -i "s|^127\.0\.0\.1.*$|127.0.0.1 localhost ${hostname}|" /etc/hosts
  40. </ACTION>
  41. </COMMAND>
  42. </VIEW>
  43. </CLISH_MODULE>