dotfiles/home/default/scripts/sync-mp3-player

20 lines
506 B
Plaintext
Raw Normal View History

2024-05-23 11:30:18 -04:00
#!/usr/bin/env sh
set -eou pipefail
if [[ ! -d /run/media/default/MUSIC ]]; then
echo "mounting /run/media/default/MUSIC"
sudo mkdir /run/media/default/MUSIC
sudo mount -U DB09-89C3 /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