]> Git — Sourcephile - julm/podcasts.git/blob - send-key.sh
update
[julm/podcasts.git] / send-key.sh
1 #!/usr/bin/env bash
2 # shellcheck disable=SC2064
3 set -eux
4
5 cd "${0%/*}"
6
7 dev=${1:-/dev/disk/by-uuid/1AEC-F13E}
8 mnt=$(mktemp -d)
9 if mountpoint "$dev"; then
10 mnt="$dev"
11 else
12 mkdir -p "$mnt"
13 sudo umount "$dev" || true
14 trap "sudo umount $mnt && rmdir $mnt && sync" EXIT
15 sudo mount -v -o uid="$USER",fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush "$dev" "$mnt"
16 fi
17
18 rsync -rv --remove-source-files \
19 --exclude "*.part" \
20 --exclude "*.part-Frag*" \
21 --exclude "*.aria2" \
22 --exclude ".*" \
23 --no-inc-recursive --info=progress2 \
24 --size-only --inplace --partial --progress -i \
25 new/ \
26 "$mnt"/