#!/bin/bash

rclone rc \
--rc-addr=192.168.10.18:5572 \
mount/unmountall

mountpoints="gdrive tdrive dropbox onedrive"

for mountpoint in $mountpoints
do
  umount "/mnt/user/Cloud/$mountpoint"
  umount "/mnt/cache/Cloud/$mountpoint"
  fusermount -uz "/mnt/user/Cloud/$mountpoint"
  fusermount -uz "/mnt/cache/Cloud/$mountpoint"
  echo "unmount $mountpoint"
done