|
@@ -1,19 +1,34 @@
|
|
|
-from dulwich import porcelain
|
|
|
+import git
|
|
|
import os
|
|
|
+from io import RawIOBase
|
|
|
|
|
|
-def ro():
|
|
|
- os.system("/etc/init.d/S01mount_ro start")
|
|
|
+localrep = "/home"
|
|
|
|
|
|
|
|
|
-def rw():
|
|
|
- os.system("/etc/init.d/S01mount_ro stop")
|
|
|
+class NewStream(RawIOBase):
|
|
|
+ """Fallback if stdout or stderr are unavailable, does nothing."""
|
|
|
|
|
|
+ def read(self, size=-1):
|
|
|
+ return None
|
|
|
|
|
|
-localrep = "/home"
|
|
|
+ def readall(self):
|
|
|
+ return None
|
|
|
+
|
|
|
+ def readinto(self, b):
|
|
|
+ return None
|
|
|
+
|
|
|
+ def write(self, b):
|
|
|
+ print(b)
|
|
|
+ return None
|
|
|
|
|
|
-rw()
|
|
|
|
|
|
-porcelain.pull(localrep)
|
|
|
-os.remove("/root/CocoPi.py")
|
|
|
-ro()
|
|
|
+git.rw()
|
|
|
+steam = NewStream()
|
|
|
+if os.path.exists(localrep + "/cclb_launch"):
|
|
|
+ os.remove(localrep + "/cclb_launch")
|
|
|
+git.pull(localrep, steam)
|
|
|
+if os.path.exists("/root/CocoPi.py"):
|
|
|
+ os.remove("/root/CocoPi.py")
|
|
|
+os.system('chmod -R 777 /home')
|
|
|
os.system('reboot')
|
|
|
+git.ro()
|