linux: assume DataStorage already mounted at ~/DataStorage
No LABEL/findmnt probe. Dropbox and workdir live under that tree.
This commit is contained in:
+7
-24
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# rclone-dropbox-bisync Linux setup
|
||||
# Dual-boot: NTFS volume labeled DataStorage, Dropbox at <mount>/Dropbox
|
||||
# Dual-boot: DataStorage already mounted at ~/DataStorage
|
||||
# Paste: curl -fsSL https://git.denkena-consulting.com/f-denkena/rclone-dropbox-bisync/raw/branch/master/linux/install.sh | bash
|
||||
|
||||
set -euo pipefail
|
||||
@@ -12,24 +12,6 @@ BIN="$HOME/.local/bin"
|
||||
CFG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/rclone-dropbox-bisync"
|
||||
UNIT_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user"
|
||||
|
||||
find_datastorage() {
|
||||
local m
|
||||
if command -v findmnt >/dev/null 2>&1; then
|
||||
m=$(findmnt -n -o TARGET -S LABEL=DataStorage 2>/dev/null | head -1 || true)
|
||||
if [ -n "$m" ]; then
|
||||
echo "$m"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
for m in /mnt/DataStorage /media/"$USER"/DataStorage /run/media/"$USER"/DataStorage /d /mnt/d /mnt/data; do
|
||||
if [ -d "$m/Dropbox" ]; then
|
||||
echo "$m"
|
||||
return
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
need() {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
}
|
||||
@@ -43,12 +25,13 @@ if ! need go; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VOL=$(find_datastorage) || {
|
||||
echo "NTFS volume LABEL=DataStorage (or .../Dropbox) not mounted" >&2
|
||||
exit 1
|
||||
}
|
||||
VOL="$HOME/DataStorage"
|
||||
DROPBOX="$VOL/Dropbox"
|
||||
WORKDIR="$VOL/rclone-bisync"
|
||||
[ -d "$VOL" ] || {
|
||||
echo "expected DataStorage already mounted at $VOL" >&2
|
||||
exit 1
|
||||
}
|
||||
[ -d "$DROPBOX" ] || {
|
||||
echo "missing $DROPBOX" >&2
|
||||
exit 1
|
||||
@@ -111,6 +94,6 @@ case ":$PATH:" in
|
||||
*) echo "Add $BIN to PATH (e.g. export PATH=\"$BIN:\$PATH\" in ~/.profile)" ;;
|
||||
esac
|
||||
|
||||
echo "Configured path1=$DROPBOX workdir=$WORKDIR (volume DataStorage)"
|
||||
echo "Configured path1=$DROPBOX workdir=$WORKDIR (~/DataStorage)"
|
||||
echo "Startup: autostart desktop + systemd --user timer every 15 min"
|
||||
echo "Put RCLONE_TEST on dropbox: as well. Remote dropbox: must exist in rclone.conf."
|
||||
|
||||
Reference in New Issue
Block a user