def test(self): commands = ["sudo ifconfig eth1 netmask 255.255.0.0", \ "sudo ifconfig eth2 netmask 255.255.0.0", \ "sudo ifconfig eth3 netmask 255.255.0.0", \ "sudo ifconfig eth4 netmask 255.255.0.0", \ "sudo ifconfig eth5 netmask 255.255.0.0"] gl.exec_ssh_commands(self.targets, commands)
def getinfo(self): gl.exec_ssh_commands(self.targets, ["route > route-log", "ifconfig > ifconfig-log"]) log_filename = self.log_formatname.format(target="{target}",logfile="route-log") command = "scp {target}:route-log " + log_filename gl.exec_command(self.targets, command) log_filename = self.log_formatname.format(target="{target}",logfile="ifconfig-log") command = "scp {target}:ifconfig-log " + log_filename gl.exec_command(self.targets, command)
def getinfo(self): gl.exec_ssh_commands(self.targets, ["route > route-log", "ifconfig > ifconfig-log"]) log_filename = self.log_formatname.format(target="{target}", logfile="route-log") command = "scp {target}:route-log " + log_filename gl.exec_command(self.targets, command) log_filename = self.log_formatname.format(target="{target}", logfile="ifconfig-log") command = "scp {target}:ifconfig-log " + log_filename gl.exec_command(self.targets, command)
def stop(self): commands = ["sudo /etc/init.d/quagga stop"] gl.exec_ssh_commands(self.targets, commands)
def restart(self): commands = ["sudo /etc/init.d/quagga restart"] gl.exec_ssh_commands(self.targets, commands)
def configure(self): command = "scp routeconfig.sh {target}:." gl.exec_command(self.targets, command) commands = ["sudo chmod +x routeconfig.sh"] gl.exec_ssh_commands(self.targets, commands)