Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print "======== VLAN config populator =========="
- def createVlans(amount, start):
- count = 0
- print "!start vlan config"
- while amount > count:
- print ("vlan {}\n name {}".format(start, ("py-vlan-" + str(start))))
- start = start + 1
- count = count + 1
- print "!finished\n"
- def createVlansIncrement(amount, start, increment):
- count = 0
- print "! start vlan config\n"
- while amount > count:
- print("vlan {}\n name {}".format(start, ("py-vlan-" + str(start))))
- start = start + increment
- count = count + 1
- print "! finished\n"
- print "[0]: Create vlans (increment by 1)"
- print "[1]: Create vlans (custom increment)"
- option = input("Please select an option (input number): ")
- if option == 0:
- op0_amount = input("Input amount of VLANS: ")
- op0_start = input("Input starting VLAN number: ")
- createVlans(op0_amount, op0_start)
- if option == 1:
- op1_amount = input("Input amount of VLANS: ")
- op1_start = input("Input starting VLAN number: ")
- op1_increment = input("Input incremental number: ")
- createVlansIncrement(op1_amount, op1_start, op1_increment)
Add Comment
Please, Sign In to add comment