dotfiles/home/default/scripts/sync-car
2024-09-21 15:56:51 -04:00

21 lines
540 B
Bash
Executable File

#!/usr/bin/env sh
set -eou pipefail
sudo mkdir -p /run/media/default/
if [[ ! -d /run/media/default/MUSIC ]]; then
echo "mounting /run/media/default/MUSIC"
sudo mkdir /run/media/default/MUSIC
sudo mount -U E6F8-C183 /run/media/default/MUSIC
fi
echo "syncing music..."
sudo rsync --info=progress2 -W -r --delete ~/Music/* /run/media/default/MUSIC/
cd /run/media/default/MUSIC
sudo generate-playlists
cd /home/default
echo "unmounting /run/media/default/MUSIC"
sudo umount /run/media/default/MUSIC
sudo rmdir /run/media/default/MUSIC