title: Exscript control cisco execute 'reload' command
body: <p>I'm ultimately trying to create some basic functions to control my cisco test lab devices using Exscript. Exscript has done everything perfectly for me up to this point and I'm just pulling a few functions for example. </p>
  
  <p>What I'm having trouble with is creating this reload_start() function that  executes the reload command, rebooting my Cisco device and reverting any changes I've made in my test run. I've tried dozens of different combinations of character strings to execute but cannot get it to work around the additional prompts that come up when typing 'reload'</p>
  
  <p>In contrast, my copy_to_running_config() function works just fine, simply by adding '\n' at the end of the string.</p>
  
  <p>I've not yet jumped into Exscript's prompt functions(get_prompt(), expect_prompt(), waitfor(), etc), and I'm guessing this is the avenue I need to explore, but I cannot find examples of this that deal with my specific goal. </p>
  
  <pre><code>from Exscript import Account
  from Exscript.protocols import Telnet
  from Exscript.protocols.drivers import ios
  
  def __init__(self, ip):
  
      self.ip = ip
      self.account = Account('admin', 'key')              
      self.conn = Telnet()        
      self.conn.set_driver('ios')     
      self.conn.connect(ip)
      self.conn.login(self.account) 
      self.conn.execute('terminal length 0')
  
  def enable(self):
      self.conn.execute('enable')
  
  def copy_to_running_config(self, config):
      self.enable()
      self.conn.execute('copy flash:{0} running-config  \n'.format(config))
      res = self.conn.response
      self.conn.execute('exit')
      return res
  
  def reload_start(self):
      self.enable()
      self.conn.execute('reload \n no \n')
      print self.conn.response
  </code></pre>
  
  <p>Any help or input would be greatly appreciated!</p>