Enable syntax highlight for the script

Mikhail Yenuchenko
2021-09-18 23:09:36 +03:00
parent 925f471eed
commit 65406878e5

@ -2,13 +2,14 @@
To enable mounting a rclone volume using system mount tool, the following helper script must be named `rclonefs` and placed in `$PATH`:
#!/bin/bash
remote=$1
mountpoint=$2
shift 2
```bash
#!/bin/bash
remote=$1
mountpoint=$2
shift 2
# Process -o parameters
while getopts :o: opts; do
# Process -o parameters
while getopts :o: opts; do
case $opts in
o)
params=${OPTARG//,/ }
@ -31,20 +32,19 @@ To enable mounting a rclone volume using system mount tool, the following helper
echo "Invalid option: -$OPTARG"
;;
esac
done
done
# exec rclone
trans="$trans $remote $mountpoint"
# NOTE: do not try "mount --daemon" here, it does not play well with systemd automount, use '&'!
# NOTE: mount is suid and ignores pre-set PATHs -> specify explicitely
PATH=$PATH rclone mount $trans </dev/null >/dev/null 2>/dev/null &
# exec rclone
trans="$trans $remote $mountpoint"
# NOTE: do not try "mount --daemon" here, it does not play well with systemd automount, use '&'!
# NOTE: mount is suid and ignores pre-set PATHs -> specify explicitely
PATH=$PATH rclone mount $trans </dev/null >/dev/null 2>/dev/null &
# wait until mounting is complete
until grep -q " ${mountpoint// /\\\\040} fuse.rclone " /proc/mounts; do
# wait until mounting is complete
until grep -q " ${mountpoint// /\\\\040} fuse.rclone " /proc/mounts; do
sleep 0.5
done
done
```
## fstab
In `/etc/fstab` you can add something like: