Use sshfs uidmap if available
This commit is contained in:
parent
3b700f3ec1
commit
52cf26a676
@ -8,8 +8,26 @@ main() {
|
||||
exit 0
|
||||
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
|
||||
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 "${@}"
|
||||
|
Loading…
Reference in New Issue
Block a user