dauzcode

smartfren zte

Jul 21st, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. #!/usr/bin/python
  2. #1.to use this code you must have one modem smartfren zte
  3. #2.you save into your Linux Ubuntu, e.g namefile.py
  4. #3.run it $ python namefile.py
  5. print """
  6. ~_~_~_~_~_~_~_~
  7. Code by Fird05 ~_~_~_~_~_~
  8. [email protected] ~_~_~_~_~
  9. _~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~
  10. """
  11.  
  12. import os
  13.  
  14. if not os.path.exists("/etc/wvdial.conf"):
  15. print "you must install wvdial"
  16. try:
  17. a = raw_input("do you sure install wvdial(y/n) = ")
  18. if a == 'y':
  19. os.system("sudo apt-get install wvdial")
  20. elif a == 'n':
  21. exit()
  22. else:
  23. print "terjadi kesalahan silahkan ulangi"
  24.  
  25. except KeyboardInterrupt:
  26. print "You hit control-c"
  27.  
  28. setup = """[Dialer Defaults]
  29. Init1 = ATZ
  30. Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
  31. Stupid Mode = 1
  32. Modem Type = Analog Modem
  33. Command Line = ATDT
  34. ISDN = 0
  35. New PPPD = yes
  36. Phone = #777
  37. Modem = /dev/ttyUSB0
  38. Username = smart
  39. Password = smart
  40. Baud = 9600
  41. """
  42.  
  43. if os.path.exists("/etc/wvdial.conf"):
  44. os.system("sudo chmod -R 777 /etc/wvdial.conf")
  45. ab = open("/etc/wvdial.conf", "r+")
  46. ab.write(setup)
  47. ab.close()
  48. os.system("sudo modprobe usbserial vendor=0x19d2 product=0xffdd")
  49. os.system("sudo wvdialconf")
  50. os.system("sudo wvdial")
Advertisement
Add Comment
Please, Sign In to add comment