create_missing_dir "/var/lib/mpd/" if ! grep -qE '/var/lib/mpd' "${TARGET_DIR}/etc/fstab"; then cat << __EOF__ >> "${TARGET_DIR}/etc/fstab" tmpfs /var/lib/mpd tmpfs rw 0 0 __EOF__ fi cat << __EOF__ > "${TARGET_DIR}/etc/mpd.conf" # Use a proxy to another instance music_directory "nfs://192.168.0.4/home/mpd/music" database { plugin "proxy" host "192.168.0.4" port "6600" } # Directory where user-made playlists are stored (RW) #playlist_directory "nfs://192.168.0.4/home/mpd/playlists" playlist_directory "/tmp/" # Log file (RW) # disable the logs log_file "/dev/null" # Process ID file (RW) pid_file "/var/run/mpd.pid" # State file (RW) state_file "/var/lib/mpd/state" # User id to run the daemon as #user "nobody" # TCP socket binding bind_to_address "any" #bind_to_address "localhost" # Unix socket to listen on bind_to_address "/var/lib/mpd/socket" audio_output { type "pulse" name "Pulseaudio" server "127.0.0.1" } __EOF__ cat << __EOF__ > "${TARGET_DIR}/home/fip.m3u" #EXTM3U #EXTINF:0,Radio France - FIP https://icecast.radiofrance.fr/fip-hifi.aac?id=radiofrance #EXTINF:0,Radio France - FIP Electro https://icecast.radiofrance.fr/fipelectro-hifi.aac?id=radiofrance #EXTINF:0,Radio France - FIP Groove https://icecast.radiofrance.fr/fipgroove-hifi.aac?id=radiofrance #EXTINF:0,Radio France - FIP HipHop https://icecast.radiofrance.fr/fiphiphop-hifi.aac?id=radiofrance #EXTINF:0,Radio France - FIP Jazz https://icecast.radiofrance.fr/fipjazz-hifi.aac?id=radiofrance #EXTINF:0,Radio France - FIP Metal https://icecast.radiofrance.fr/fipmetal-hifi.aac #EXTINF:0,Radio France - FIP Nouveautés https://icecast.radiofrance.fr/fipnouveautes-hifi.aac?id=radiofrance #EXTINF:0,Radio France - FIP Reggae https://icecast.radiofrance.fr/fipreggae-hifi.aac?id=radiofrance #EXTINF:0,Radio France - FIP Rock https://icecast.radiofrance.fr/fiprock-hifi.aac?id=radiofrance #EXTINF:0,Radio France - FIP World https://icecast.radiofrance.fr/fipworld-hifi.aac?id=radiofrance __EOF__ cat << __EOF__ > "${TARGET_DIR}/home/nova.m3u" #EXTM3U #EXTINF:0,Radio Nova https://novazz.ice.infomaniak.ch/novazz-128.mp3 #EXTINF:0,Nova Nouvo https://nova-nouvo.ice.infomaniak.ch/nova-nouvo-128.mp3 __EOF__ cat << __EOF__ > "${TARGET_DIR}/etc/systemd/system/playlists.service" [Unit] Description=Playlists After=network-online.target Wants=network-online.target [Service] Type=unit ExecStartPre=sleep 3 ExecStart=find /home/ -name '*.m3u' -exec cp {} /tmp \; [Install] WantedBy=multi-user.target __EOF__ # Create the link to the system configuration ln -sf /etc/systemd/system/playlists.service "${TARGET_DIR}/usr/lib/systemd/system/multi-user.target.wants/playlists.service"