More playing around with sshfs
This commit is contained in:
parent
52cf26a676
commit
fc341521be
@ -3,7 +3,9 @@ set -o errexit
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
if [[ -f ~/mnt/jool/.mounted ]]; then
|
if [[ "${REMOUNT}" == enabled ]]; then
|
||||||
|
fusermount -u ~/mnt/jool 2>/dev/null || true
|
||||||
|
elif [[ -f ~/mnt/jool/.mounted ]]; then
|
||||||
printf 'Already mounted\n' >&2
|
printf 'Already mounted\n' >&2
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@ -11,13 +13,20 @@ main() {
|
|||||||
local sshfs_args=(
|
local sshfs_args=(
|
||||||
me@jool:/store/sshfs/meatballhat
|
me@jool:/store/sshfs/meatballhat
|
||||||
~/mnt/jool
|
~/mnt/jool
|
||||||
|
-o auto_unmount
|
||||||
|
-o default_permissions
|
||||||
|
-o reconnect
|
||||||
-p 23436
|
-p 23436
|
||||||
-C
|
-C
|
||||||
)
|
)
|
||||||
|
|
||||||
local sshfs_uidfile="${HOME}/.config/sshfs-$(_hostname)-uidmap"
|
local sshfs_uidfile="${HOME}/.config/sshfs-$(_hostname)-uidmap"
|
||||||
if [[ -f "${sshfs_uidfile}" ]]; then
|
if [[ -f "${sshfs_uidfile}" ]]; then
|
||||||
sshfs_args=(-o uidfile="${sshfs_uidfile}" "${sshfs_args[@]}")
|
sshfs_args=("${sshfs_args[@]}" -o uidfile="${sshfs_uidfile}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${DEBUG}" == enabled ]]; then
|
||||||
|
sshfs_args=("${sshfs_args[@]}" -f -o sshfs_debug -o LogLevel=DEBUG3)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p ~/mnt/jool
|
mkdir -p ~/mnt/jool
|
||||||
|
Loading…
x
Reference in New Issue
Block a user