Skip to content

Commit

Permalink
Added user prompt and logic to update raspiwifi.conf for new SSL opti…
Browse files Browse the repository at this point in the history
…on during initial_setup.
  • Loading branch information
jasbur committed Jul 8, 2018
1 parent fcb03cf commit 5d33b4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions initial_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
auto_config_choice = input("Would you like to enable \nauto-reconfiguration mode (y/n)? [default: n]: ")
print()
auto_config_delay = input("How long of a delay would you like without an active connection \nbefore auto-reconfiguration triggers (seconds)? [default: 300]: ")
print()
ssl_enabled_choice = input("Would you like to enable SSL during configuration mode (y/n)? [default: n]: ")
os.system('clear')
print()
print()
Expand Down
4 changes: 3 additions & 1 deletion setup_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ def copy_configs():
os.system('echo "@reboot root run-parts /etc/cron.raspiwifi/" >> /etc/crontab')
os.system('mv /usr/lib/raspiwifi/reset_device/static_files/raspiwifi.conf /etc/raspiwifi')

def update_main_config_file(entered_ssid, auto_config_choice, auto_config_delay):
def update_main_config_file(entered_ssid, auto_config_choice, auto_config_delay, ssl_enabled_choice):
if entered_ssid != "":
os.system('sed -i \'s/RaspiWiFi Setup/' + entered_ssid + '/\' /etc/raspiwifi/raspiwifi.conf')
if auto_config_choice.lower() == "y":
os.system('sed -i \'s/auto_config=0/auto_config=1/\' /etc/raspiwifi/raspiwifi.conf')
if auto_config_delay != "":
os.system('sed -i \'s/auto_config_delay=300/auto_config_delay=' + auto_config_delay + '/\' /etc/raspiwifi/raspiwifi.conf')
if ssl_enabled_choice.lower() == "y":
os.system('sed -i \'s/ssl_enabled=0/ssl_enabled=1/\' /etc/raspiwifi/raspiwifi.conf')

0 comments on commit 5d33b4b

Please sign in to comment.