kunsis-dotfiles/.bin/voc-mount

24 lines
453 B
Bash
Executable file

#!/bin/bash
# mount a voc encoder or minion to /video
device=$1
[[ -n "$DEBUG" ]] && set -x
set -euo pipefail
uid="$(id -u)"
if [[ -z "$device" ]]
then
echo "Usage: $0 <device>" >&2
exit 1
fi
if ! [[ -d "/video/fuse" ]]
then
sudo mkdir -p "/video/fuse"
fi
sudo mount -t cifs -o "uid=${uid},password=" "//${device}.lan.c3voc.de/video" "/video"
sudo mount -t cifs -o "uid=${uid},password=" "//${device}.lan.c3voc.de/fuse" "/video/fuse"