#!/bin/sh

if /system/dunehd/dunehd_service "do" killall clouddrive 2>/dev/null; then
  echo CD2 killed OK.
  sleep 1
else
  echo CD2 not killed.
fi

cat /proc/mounts | grep CloudFS | awk '{print $2}' | grep -v '^/mnt/runtime' \
  | while read x;
do
  [ "$x" == "" ] && continue
  echo "umount $x (CloudFS)"
  /system/dunehd/dunehd_service do umount $x
done
