Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import os
- from sys import stdout
- from time import sleep
- print ("""
- \033[2J\033[0;35;1m--------------------------------------------------------\033[0m
- This program will flash a Ubiquiti radio with the AREDN
- firmare.
- \033[31;1mWARNING!\033[0m Your Ubiquiti radio must be one of these:
- AirGrid M2 (XM)
- AirGrid M5 (XM)
- Bullet M2
- Bullet M5
- Bullet M2 Titanium
- Bullet M5 Titanium
- NanoBridge M2G18
- NanoBridge M3
- NanoBridge M5G22
- NanoBridge M5G25
- NanoBridge M9
- NanoStation Loco M2
- NanoStation Loco M5 (XM)
- NanoStation Loco M9
- PicoStation M2
- Please make sure the interface through which you will be
- programming has an IP on the 192.168.1.0/24 subnet, such
- as 192.168.1.10 (but NOT 192.168.1.1 or 192.168.1.20,
- because the radio will use these IPs).
- Put the radio in flash mode:
- While holding RESET, power the radio and wait for the
- LEDs to be alternate between:
- \033[0;1;32m◼ \033[32m◼ \033[31m◼ \033[30m◻ \033[32m◼ \033[30m◻ \033[0m and \033[0;1;32m◼ \033[32m◼ \033[30m◻ \033[33m◼ \033[30m◻ \033[32m◼ \033[0m
- """)
- result = input("Type '\033[32;1mYES\033[0m' to proceed, or anything else to abort \033[36;1m> \033[33m")
- print ("\033[0;35;1m--------------------------------------------------------\033[0m")
- if result.upper() == "YES":
- print ("Ok, proceeding...")
- print ("")
- print ("Uploading firmware...")
- os.system("printf 'connect 192.168.1.20\nmode binary\nput aredn-3.19.3.0-ubnt-bullet-m-factory.bin' | tftp")
- print ("""
- Now we wait for the the LEDs to be: \033[0;1;32m◼ \033[32m◼ \033[30m◻ \033[30m◻ \033[30m◻ \033[32m◼ \033[0m
- """)
- for timer in range(150):
- print ("\rWaiting "+str(150-timer)+" seconds...", end='')
- stdout.flush()
- sleep(1)
- print ("""
- Okay, done! Now configure the AREDN firmware at:
- http://root:hsmm@192.168.1.1/cgi-bin/setup
- \033[0;35;1m--------------------------------------------------------\033[0m
- """)
- else:
- print ("Ok, aborting procedure.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement