#!/system/bin/sh

log -p i -t arter97 remounting /system with discard option
busybox mount -o remount,discard /system
log -p i -t arter97 remounting /data with discard option
busybox mount -o remount,discard /data
log -p i -t arter97 remounting /cache with discard option
busybox mount -o remount,discard /cache

log -p i -t arter97 fstrimming /system
/system/xbin/fstrim -v /system 2>&1 | while read log; do log -p i -t arter97 $log; done
log -p i -t arter97 fstrimming /data
/system/xbin/fstrim -v /data 2>&1 | while read log; do log -p i -t arter97 $log; done
log -p i -t arter97 fstrimming /cache
/system/xbin/fstrim -v /cache 2>&1 | while read log; do log -p i -t arter97 $log; done

log -p i -t arter97 syncing
sync
