summaryrefslogtreecommitdiffstats
path: root/prebuilt/common/etc/init.d/06mountdl
blob: 14bc167f899bb86335b1f7d62fec9065537a1a49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/system/bin/sh
#
# bind mount /data/local/download to /cache/download if cache
# partition is too small
#

CACHESIZE=$(df -k /cache | tail -n1 | tr -s ' ' | cut -d ' ' -f2)
DATAONLY=$(getprop dalvik.vm.dexopt-data-only)
if [ $DATAONLY -eq 1 ]
then
  NEEDED=60000
else
  NEEDED=105000
fi

if [ $CACHESIZE -lt $NEEDED ]
then
  mount -o bind /data/local/download /cache/download
fi

rm /cache/download/downloadfile*.apk >/dev/null 2>&1

exit 0