pandora-scripts: make op_nubmode.py update nubs.state directly
[openpandora.oe.git] / recipes / pandora-system / pandora-scripts / op_nubmode.py
index 8183e8b..3086271 100755 (executable)
@@ -6,6 +6,7 @@ import sys
 import gtk
 import time
 import optparse
+import shutil
 
 # ================================================================
 
@@ -289,6 +290,10 @@ class NubConfig(object):
 
     def on_WriteNubConfig_clicked(self, widget, *data):
         StoreProc(self.model.settings)
+        shutil.copyfile("/etc/pandora/conf/nubs.state", "/tmp/nubs.state");
+        os.system("sed -i -e '1c\%s' /tmp/nubs.state" % self.model.settings['mode0'])
+        os.system("sed -i -e '7c\%s' /tmp/nubs.state" % self.model.settings['mode1'])
+        shutil.copyfile("/tmp/nubs.state", "/etc/pandora/conf/nubs.state");
         self.Notify("Nub configuration updated.")
 
     def on_SaveProfile_clicked(self, widget, *data):