Advertisement
Guest User

Untitled

a guest
Jun 5th, 2017
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.69 KB | None | 0 0
  1. #
  2. # Simple scripts useful when adding debian to a cyanogenmod rom, or possibly any other rooted, android phone.
  3. #
  4. ===== 25mount_ext =====
  5. #!/system/bin/sh
  6.  
  7. #
  8. # /system/etc/init.d/25mount_ext
  9. #
  10.  
  11. #
  12. # Michael "Ryo-ohki" Cheselka
  13. # cheselka@gmail.com
  14. # 2010-07-16
  15. #
  16.  
  17. if [ ! -d /mnt/sd-ext ] ;
  18. then
  19.     mount -o remount,rw / ;
  20.     mkdir /mnt/sd-ext ;
  21.     chmod o-w /mnt/sd-ext ;
  22.     [ ! -h /sd-ext ] && ln -s /mnt/sd-ext /sd-ext ;
  23.     mount -o remount,ro / ;
  24. fi ;
  25. mount -t ext2 /dev/block/vold/179:3 /mnt/sd-ext ;
  26. ===== 30swapon =====
  27. #!/system/bin/sh
  28. #
  29. # /system/etc/init.d/30swapon
  30. #
  31.  
  32. #
  33. # Michael "Ryo-ohki" Cheselka
  34. # cheselka@gmail.com
  35. # 2010-07-16
  36. #
  37.  
  38. #
  39. # swapon /dev/block/mmcblk0p2 ( linux /dev/sdb2)
  40. #
  41.  
  42. swapon /dev/block/mmcblk0p2 ;
  43. sysctl -w vm.swappiness=10 ;
  44. ===== toggle_sshd =====
  45. #!/system/bin/sh
  46.  
  47. #
  48. # /system/bin/toggle_sshd
  49. # /sdcard/ase/scripts/toggle_sshd.sh
  50. #
  51.  
  52. #
  53. # Michael "Ryo-ohki" Cheselka
  54. # cheselka@gmail.com
  55. # 2010-07-16
  56. #
  57.  
  58. export HOME=/root
  59. export PATH="/sbin:/system/sbin:/system/bin:/system/xbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin"
  60. export TERM=linux
  61.  
  62. if [ $( pgrep -f /usr/sbin/sshd ) ] ; then
  63.   chroot /sd-ext/debian /etc/init.d/ssh stop ;
  64.   umount /sd-ext/debian/sdcard /sd-ext/debian/data /sd-ext/debian/sys /sd-ext/debian/dev/pts /sd-ext/debian/proc ;
  65.   sysctl -w net.ipv4.ip_forward=0 ;
  66. else
  67.   mount -o bind /sdcard /sd-ext/debian/sdcard ;
  68.   mount -o bind /data /sd-ext/debian/data ;
  69.   mount -t sysfs sysfs /sd-ext/debian/sys ;
  70.   mount -t devpts devpts /sd-ext/debian/dev/pts ;
  71.   mount -t proc proc /sd-ext/debian/proc ;
  72.   sysctl -w net.ipv4.ip_forward=1 ;
  73.   chroot /sd-ext/debian /etc/init.d/ssh start ;
  74. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement