Advertisement
alexforsale

Untitled

Nov 13th, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #!/system/bin/sh
  2. # Copyright (C) 2014 alexforsale
  3.  
  4. # Stop if no mmcblk1p2 detected
  5. if [ ! -e /dev/block/mmcblk1p2 ]
  6. then
  7. exit
  8. fi;
  9.  
  10. busybox umount /mnt/sd-ext/
  11. busybox mount -o noatime,nodiratime,nosuid,nodev /dev/block/mmcblk1p2 /mnt/sd-ext
  12. busybox mount -o remount,rw /data
  13.  
  14. # Create directories if needed
  15.  
  16. for dir in app app-lib app-private; #data dalvik-cache
  17. do
  18. if [ ! -e "/mnt/sd-ext/$dir" ];
  19. then
  20. mkdir "/mnt/sd-ext/$dir";
  21. fi;
  22. ## Move existing files
  23. for files in `ls /data/$dir`;
  24. do
  25. cp -r /data/$dir/$files /mnt/sd-ext/$dir;
  26. #rm -rf /data/$dir/$files
  27. done;
  28. #mount bind
  29. busybox mount -o bind /mnt/sd-ext/$dir /data/$dir;
  30. done;
  31.  
  32. #set permission
  33. for a in app app-lib app-private; #data dalvik-cache
  34. do
  35. chown system:system /data/$a;
  36. chown system:system /data/$a/*;
  37. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement