Last active
January 4, 2016 11:49
-
-
Save kocogluali/8617694 to your computer and use it in GitHub Desktop.
Debian Python ile Driver Yedekleme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#super user olmadan çalışmaz ona göre :) | |
import os, zipfile | |
ZF=zipfile.ZipFile("modules.zip","w") | |
A=os.popen("lsmod").read() | |
M=A.split("\n") | |
for l in M[1:]: | |
ls=l.strip() | |
if ls: | |
m=ls.split()[0] | |
M=os.popen("modinfo %s" % m).read() | |
MF=M.split("\n") | |
for t in MF: | |
if t[:9]=='filename:': | |
tn=t.strip().split()[1] | |
print (tn,"Ekleniyor") | |
ZF.write(tn) | |
ZF.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment