Use sshfs uidmap if available

This commit is contained in:
Dan Buch 2021-02-14 09:40:45 -05:00
parent 3b700f3ec1
commit 52cf26a676
Signed by: meatballhat
GPG Key ID: 9685130D8B763EA7

View File

@ -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 "${@}"