|
7 | 7 | def install_prereqs():
|
8 | 8 | project_path = os.path.dirname(os.path.abspath(__file__))
|
9 | 9 |
|
10 |
| - print("Updating Apt...") |
11 | 10 | os.system('apt update')
|
12 |
| - print("Installing prerequisites via Apt...") |
| 11 | + os.system('clear') |
13 | 12 | os.system('apt install python3 bundler libsqlite3-dev isc-dhcp-server hostapd libxml2-dev libxslt-dev -y')
|
14 |
| - print("Installing necessary Ruby Gems. This can take a few minutes...") |
| 13 | + os.system('clear') |
15 | 14 | os.system('gem install nokogiri --no-document -v 1.6.6.2 -- --use-system-libraries')
|
| 15 | + os.system('clear') |
16 | 16 | os.system('bundle install --gemfile=' + project_path + '/Configuration\ App/Gemfile')
|
| 17 | + os.system('clear') |
17 | 18 |
|
18 | 19 | def update_config_paths():
|
19 | 20 | project_path = os.path.dirname(os.path.abspath(__file__))
|
@@ -47,66 +48,44 @@ def update_config_paths():
|
47 | 48 | #################################################################
|
48 | 49 | #################################################################
|
49 | 50 |
|
50 |
| - |
| 51 | +os.system('clear') |
| 52 | +print() |
51 | 53 | print()
|
52 | 54 | print("###################################")
|
53 | 55 | print("##### RaspiWiFi Intial Setup #####")
|
54 | 56 | print("###################################")
|
55 | 57 | print()
|
56 | 58 | print()
|
57 |
| -install_prereqs_ans = input("Would you like to install prerequisite files (This can take up to 5 minutes)? (y/n): ") |
| 59 | +install_ans = input("Would you like run the initial RaspiWiFi setup (This can take up to 5 minutes)? (y/n): ") |
58 | 60 |
|
59 |
| -if(install_prereqs_ans == 'y'): |
60 |
| - print() |
61 |
| - print("Updating system...") |
| 61 | +if(install_ans == 'y'): |
62 | 62 | install_prereqs()
|
63 |
| -else: |
64 |
| - print() |
65 |
| - print() |
66 |
| - print("===================================================") |
67 |
| - print("---------------------------------------------------") |
68 |
| - print() |
69 |
| - print("No Prerequisites installed. Continuing to configuration file installation...") |
70 |
| - print() |
71 |
| - print("---------------------------------------------------") |
72 |
| - print("===================================================") |
73 |
| - print() |
74 |
| - print() |
75 |
| - |
76 |
| -print() |
77 |
| -print() |
78 |
| -print() |
79 |
| -print() |
80 |
| -run_setup_ans = input("Would you like to run the initial setup for RaspiWiFi? (y/n): ") |
81 |
| - |
82 |
| -if(run_setup_ans == 'y'): |
83 |
| - print("Updating config files and copying them...") |
84 | 63 | update_config_paths()
|
85 | 64 |
|
86 | 65 | os.system('sudo rm -f /etc/wpa_supplicant/wpa_supplicant.conf')
|
87 | 66 | os.system('rm -f ./tmp/*')
|
88 |
| - os.system('sudo cp -r ./Reset\ Device/static_files/dhcpd.conf /etc/dhcp/') |
89 |
| - os.system('sudo cp -r ./Reset\ Device/static_files/hostapd.conf /etc/hostapd/') |
90 |
| - os.system('sudo cp -r ./Reset\ Device/static_files/interfaces.aphost /etc/network/interfaces') |
91 |
| - os.system('sudo cp -r ./Reset\ Device/static_files/isc-dhcp-server.aphost /etc/default/isc-dhcp-server') |
92 |
| - os.system('sudo cp -r ./Reset\ Device/static_files/rc.local.aphost /etc/rc.local') |
| 67 | + os.system('sudo cp -a ./Reset\ Device/static_files/dhcpd.conf /etc/dhcp/') |
| 68 | + os.system('sudo cp -a ./Reset\ Device/static_files/hostapd.conf /etc/hostapd/') |
| 69 | + os.system('sudo cp -a ./Reset\ Device/static_files/interfaces.aphost /etc/network/interfaces') |
| 70 | + os.system('sudo cp -a ./Reset\ Device/static_files/isc-dhcp-server.aphost /etc/default/isc-dhcp-server') |
| 71 | + os.system('sudo cp -a ./Reset\ Device/static_files/rc.local.aphost /etc/rc.local') |
93 | 72 | else:
|
94 | 73 | print()
|
95 | 74 | print()
|
96 | 75 | print("===================================================")
|
97 | 76 | print("---------------------------------------------------")
|
98 | 77 | print()
|
99 |
| - print("RaspiWiFi initial setup cancelled. No changes made.") |
| 78 | + print("RaspiWiFi installation cancelled. Nothing changed...") |
100 | 79 | print()
|
101 | 80 | print("---------------------------------------------------")
|
102 | 81 | print("===================================================")
|
103 | 82 | print()
|
104 | 83 | print()
|
105 |
| - sys.exit(0) |
| 84 | + sys.exit() |
106 | 85 |
|
107 | 86 | print()
|
108 | 87 | print()
|
109 |
| -reboot_ans = input("Initial setup is complete. A reboot is required, would you like to do that now? (y/n): ") |
| 88 | +reboot_ans = input("Initial setup is complete. A reboot is required to start in WiFi configuration mode, would you like to do that now? (y/n): ") |
110 | 89 |
|
111 |
| -if(run_setup_ans == 'y' and reboot_ans == 'y'): |
| 90 | +if reboot_ans == 'y': |
112 | 91 | os.system('sudo reboot')
|
0 commit comments