Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

let user set SSID via command-line argument #5

Closed
wants to merge 1 commit into from

1 participant

@thatandromeda

No description provided.

@thatandromeda

Realized I need to prompt for user input. This will be superseded by a better pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 23, 2012
  1. @thatandromeda
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 21 deletions.
  1. +7 −1 LibraryBox 1.5/alter_SSID.py
  2. +0 −20 LibraryBox 1.5/wireless
View
8 LibraryBox 1.5/alter_SSID.py
@@ -1,16 +1,22 @@
#!/usr/bin/env python
from os import remove, rename
+from sys import argv
def alter_SSID():
"""
customize the SSID for Librarybox
+ if a command-line argument is taken, it will use that as the SSID
+ otherwise it will default to Librarybox - Free Content
"""
source = open('/etc/config/wireless', 'r')
destination = open('/etc/config/wireless_new', 'w')
for line in source:
if (line.find('PirateBox - Share Freely') > -1):
- line = line.replace('PirateBox - Share Freely', 'LibraryBox - Free Content!')
+ if argv[1]:
+ line = line.replace('PirateBox - Share Freely', argv[1])
+ else:
+ line = line.replace('PirateBox - Share Freely', 'LibraryBox - Free Content!')
destination.write(line)
source.close()
View
20 LibraryBox 1.5/wireless
@@ -1,20 +0,0 @@
-
-config wifi-device 'radio0'
- option type 'mac80211'
- option channel '11'
- option macaddr 'f8:d1:11:9e:87:fc'
- option hwmode '11ng'
- option htmode 'HT20'
- list ht_capab 'SHORT-GI-20'
- list ht_capab 'SHORT-GI-40'
- list ht_capab 'RX-STBC1'
- list ht_capab 'DSSS_CCK-40'
- option disabled '0'
-
-config wifi-iface
- option device 'radio0'
- option network 'lan'
- option mode 'ap'
- option encryption 'none'
- option ssid 'LibraryBox - Free Content!'
-
Something went wrong with that request. Please try again.