#!/usr/bin/env sh set -eou pipefail sudo mkdir -p /run/media/default echo "mounting /run/media/default/MUSIC" sudo fsck -fy /dev/disk/by-uuid/4619-9B49 || true sudo mkdir -p /run/media/default/MUSIC || true sudo mount -U 4619-9B49 /run/media/default/MUSIC echo "syncing music..." sudo rsync --info=progress2 -W -r --delete /home/default/Music/* /run/media/default/MUSIC/ sudo sync /run/media/default/MUSIC/ cd /run/media/default/MUSIC sudo /home/default/scripts/generate-playlists cd /home/default echo "unmounting /run/media/default/MUSIC" sudo umount /run/media/default/MUSIC sudo rmdir /run/media/default/MUSIC