-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an initial_setup.rb Ruby script in the root directory to be run…
… the first time after cloning. This will set the Raspberry Pi into its wifi configuration mode.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
puts | ||
puts "###################################" | ||
puts "##### RaspiWiFi Initial Setup #####" | ||
puts "###################################" | ||
puts | ||
puts | ||
print "Would you like to run the initial setup for RaspiWiFi? (y/n): " | ||
run_setup_ans = gets.chomp.downcase | ||
|
||
if run_setup_ans == 'y' | ||
system('sudo rm -f /etc/wpa_supplicant/wpa_supplicant.conf') | ||
system('rm -f ./tmp/*') | ||
system('sudo cp -r ./Reset\ Device/static_files/dhcpd.conf /etc/dhcp/') | ||
system('sudo cp -r ./Reset\ Device/static_files/hostapd.conf /etc/hostapd/') | ||
system('sudo cp -r ./Reset\ Device/static_files/interfaces.aphost /etc/network/interfaces') | ||
system('sudo cp -r ./Reset\ Device/static_files/isc-dhcp-server.aphost /etc/default/isc-dhcp-server') | ||
system('sudo cp -r ./Reset\ Device/static_files/rc.local.aphost /etc/rc.local') | ||
else | ||
puts | ||
puts | ||
puts "---------------------------------------------------" | ||
puts "---------------------------------------------------" | ||
abort("RaspiWiFi initial setup cancelled. No changes made.") | ||
end | ||
|
||
puts | ||
puts | ||
print "Initial setup is complete. A reboot is required, would you like to do that now? (y/n): " | ||
reboot_ans = gets.chomp.downcase | ||
|
||
if run_setup_ans == 'y' and reboot_ans == 'y' | ||
system('sudo reboot') | ||
end |