forked from jgaurilo/SmokeScreen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mount.remote
37 lines (29 loc) · 986 Bytes
/
mount.remote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
###############################################################################
. ${HOME}/.config/GSUITE/gsuite.conf
# Unmount drives
/bin/bash ${bindir}/unmount.remote 2>&1
sleep 10
# Mount drives
echo "$(date "+%d.%m.%Y %T") INFO: Mounting filesystems"
if [ "${cloudsubdir}" = "" ]; then
echo "configuration option cloudsubdir must be set to a value!"
exit 1
fi
# Make sure all folders exist
echo "$(date "+%d.%m.%Y %T") INFO: Creating mountpoints"
mkdir -p "${clouddir}"
mkdir -p "${mediadir}"
#Cloud data
echo "$(date "+%d.%m.%Y %T") INFO: Mounting ${clouddir}"
$rclonebin mount ${rclonemountopts} ${cacheremote}: "${clouddir}" &
if [ ! "${cloudsubdir}" = "" ]; then
while [ ! -d "${clouddir}/${cloudsubdir}" ]; do
sleep 10
done
fi
#Union of Cloud/Local
echo "$(date "+%d.%m.%Y %T") INFO: Mounting ${mediadir}"
$ufsbin ${unionmountopts} ${localdir}=RW:${clouddir}/${cloudsubdir}=RO "${mediadir}"
echo "$(date "+%d.%m.%Y %T") INFO: File systems mounted"
exit