We have 15 PCs in our network. If there is a big meeting, we want to play a sound (from a file, just some seconds) on all PCs in our network.
Most of them run Ubuntu, some run SuSE.
How can I solve this?
We have 15 PCs in our network. If there is a big meeting, we want to play a sound (from a file, just some seconds) on all PCs in our network.
Most of them run Ubuntu, some run SuSE.
How can I solve this?
Use play
command to play the file. So something like ssh user@hostname play /location/of/file.mp3
on each of the PCs. If up to 5 seconds delay is alright then you can simply use a for loop to run that command from any PC. Something like for PC in list of hostnames; do ssh user@$PC "play /location/of/file.mp3" & done
.
Setting up public key authentication will eliminate the need for password inputting for each of the hosts. How can I set up password-less SSH login?
parallel
to avoid scripting. "a shell tool for executing jobs in parallel using one or more computers": https://www.gnu.org/software/parallel/
– Marcus
Mar 10 '16 at 02:41
I think streaming audio in your network can be a solution for your case.
have a look on this question: How to stream music over the network to multiple computers?
play
command to play the file. So something likessh user@hostname play /location/of/file.mp3
on each of the PCs. If up to 5 seconds delay is ok then you can simply use for loop to run that command. Something likefor PC in list of hostnames; do ssh user@$PC "play /location/of/file.mp3" &; done
– mbiber Mar 02 '16 at 14:36ssh
with password authentication will stop and wait till you enter the password. You need to set key authentication if you wish this script to run seamlessly. – whtyger Mar 04 '16 at 12:52