improve scripts
This commit is contained in:
parent
50087596d0
commit
91ba874d57
15
home/default/scripts/sync-mp3-player
Executable file
15
home/default/scripts/sync-mp3-player
Executable file
@ -0,0 +1,15 @@
|
||||
#!/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/albums ~/Music/mixes ~/Music/playlists/* /run/media/default/MUSIC/
|
||||
|
||||
echo "unmounting /run/media/default/MUSIC"
|
||||
sudo umount /run/media/default/MUSIC
|
||||
sudo rmdir /run/media/default/MUSIC
|
9
home/default/scripts/syncthing-rm-stversions
Executable file
9
home/default/scripts/syncthing-rm-stversions
Executable file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
if compgen -G "/home/default/syncthing/*/.stversions/*" > /dev/null; then
|
||||
rm -rf /home/default/syncthing/*/.stversions/*
|
||||
echo "deleted all .stversions"
|
||||
else
|
||||
echo "no .stversions to remove"
|
||||
fi
|
Loading…
Reference in New Issue
Block a user