forked from szafranski/RH-ota
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnet_hotspot_auto_11.py
More file actions
executable file
·59 lines (42 loc) · 2.33 KB
/
Copy pathnet_hotspot_auto_11.py
File metadata and controls
executable file
·59 lines (42 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from modules import Bcolors, clear_the_screen
import os
def net_hotspot_auto_11(config):
while True:
clear_the_screen()
features_menu_content = """
{bold} Automatic Hotspot / Wi-Fi setup{endc}
Automatic hotspot will configure your timer to connect to any previously
known Wi-Fi network if detected on startup.
If no known network is found, the timer will create a self-hosting hotspot
that can be connected to on address: 10.0.0.5 (or <your_hostname>.local)
The command 'autohotspot' will be available after install to re-detect Wi-Fi.
Rebooting the timer will also cause it to re-detect know Wi-Fi networks
or create the hotspot (if known networks are not present).
{green} y - Start auto hotspot config {endc}
{yellow} e - Exit to main menu {endc}
""".format(bold=Bcolors.BOLD_S, underline=Bcolors.UNDERLINE, endc=Bcolors.ENDC,
blue=Bcolors.BLUE, yellow=Bcolors.YELLOW_S, red=Bcolors.RED_S, green=Bcolors.GREEN_S)
print(features_menu_content)
selection = input()
if selection == 'y':
clear_the_screen()
os.system(f"sudo /home/{config.user}/RH_Install-Manager/resources/autohotspot/setup_autohotspot.sh")
print("""
#######################################################################
# #
# {bg} Configuring auto hotspot is complete - service active{endc} #
# #
# {bold} Thank you! {endc} #
# #
#######################################################################\n\n
""".format(nodes_number=config.nodes_number, bold=Bcolors.BOLD_S,
bg=Bcolors.BOLD + Bcolors.GREEN + (' ' * 4), endc=Bcolors.ENDC_S))
input("Press 'Enter' to continue")
break
elif selection == 'e':
break
pass
def main():
net_hotspot_auto_11()
if __name__ == "__main__":
main()