Use sshfs uidmap if available
This commit is contained in:
parent
3b700f3ec1
commit
52cf26a676
@ -8,8 +8,26 @@ main() {
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local sshfs_args=(
|
||||||
|
me@jool:/store/sshfs/meatballhat
|
||||||
|
~/mnt/jool
|
||||||
|
-p 23436
|
||||||
|
-C
|
||||||
|
)
|
||||||
|
|
||||||
|
local sshfs_uidfile="${HOME}/.config/sshfs-$(_hostname)-uidmap"
|
||||||
|
if [[ -f "${sshfs_uidfile}" ]]; then
|
||||||
|
sshfs_args=(-o uidfile="${sshfs_uidfile}" "${sshfs_args[@]}")
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p ~/mnt/jool
|
mkdir -p ~/mnt/jool
|
||||||
sshfs me@jool:/store/sshfs/meatballhat ~/mnt/jool -p 23436 -C
|
sshfs "${sshfs_args[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
|
_hostname() {
|
||||||
|
hostname 2>/dev/null ||
|
||||||
|
hostnamectl status --static 2>/dev/null ||
|
||||||
|
echo unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
main "${@}"
|
main "${@}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user