[rclone] Init.d script - why does this fail?

Yay! This works!

So how should I fix all this.

My script now looks like this:

root@OpenWrt:/etc/init.d# cat mount-onedrive
#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org

while read ENV_VAR
do export "${ENV_VAR}"
done < /etc/rclone.env

exec &> /tmp/mount-onedrive.log
set -x -v
env

START=97
STOP=5

start() {
        rclone --config /etc/rclone/rclone.conf mkdir /tmp/OneDrive
        rclone --config /etc/rclone/rclone.conf mount "OneDrive:/Scanned Documents/" /tmp/OneDrive/ --vfs-cache-mode full --umask 000 --allow-other --daemon
}

stop() {
        fusermount -zu /tmp/OneDrive
}
1 Like