Skip to content

Loading…

alter_SSID.py, here you go #3

Merged
merged 1 commit into from

2 participants

@thatandromeda

One SSID-changing script for you. Needs to be tested in production environment, which I don't have (in particular: is the first line locally correct; does anything need to be done about permissions). Haven't altered your shell script to invoke it. You sure you don't want a command-line option for user-customizable SSID?

@griffey griffey merged commit 7805c35 into griffey:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 31, 2012
  1. @thatandromeda

    script to change SSID

    thatandromeda committed
Showing with 23 additions and 0 deletions.
  1. +23 −0 LibraryBox 1.5/alter_SSID.py
View
23 LibraryBox 1.5/alter_SSID.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+from os import remove, rename
+
+def alter_SSID():
+ """
+ customize the SSID for Librarybox
+ """
+ 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!')
+ destination.write(line)
+
+ source.close()
+ destination.close()
+
+ remove('/etc/config/wireless')
+ rename('/etc/config/wireless_new', '/etc/config/wireless')
+
+if __name__=="__main__":
+ alter_SSID()
Something went wrong with that request. Please try again.