-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34f335a
commit ed5e041
Showing
5 changed files
with
62 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
KERNEL=="sd[a-z]?", SUBSYSTEM=="block", ACTION=="add", RUN+="/usr/local/bin/import_music.sh %k" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
###### | ||
# Copy the $extension files from the root folder (/) | ||
# of a USB key to the $destination folder | ||
# | ||
# $1 : Device's kernel name | ||
###### | ||
|
||
extension="song" | ||
destination="/home/pi/songs" | ||
user="pi" | ||
led="5" | ||
|
||
gpio mode $led out | ||
gpio write $led 1 | ||
|
||
mkdir /media/song_$1 | ||
|
||
mount /dev/$1 /media/song_$1 | ||
|
||
echo "mounted" >> /home/pi/truc.txt | ||
|
||
cp -n /media/song_$1/*.$extension $destination | ||
sudo chown -R $user $destination | ||
sync | ||
|
||
umount /media/song_$1 | ||
rmdir /media/song_$1 | ||
|
||
gpio write $led 0 | ||
|
This file was deleted.
Oops, something went wrong.