Post Tue Apr 22, 2014 10:40 pm

Script to toggle Serviio from start to stop to start to stop

Hello Serviio forum,

I know there are already linux daemon scripts for Serviio ( viewtopic.php?f=4&t=71&_ga=1.19708602.327939936.1392049679 ) but I stumbled upon a simple script that you can place on your desktop as an icon and when clicked on, the Serviio server starts and when the same icon is clicked on again, the Serviio server stops. In other words, one icon will toggle the server from start to stop to start again to stop, etc. I know it works in Linux Gentoo and Ubuntu bases systems, and I suppose with other linux distributions also, just so it has /dev/null.

Here is the simple script:

  Code:
#!/bin/sh

 /home/royroy/serviio-1.4.1.2/bin/serviio.sh  > /dev/null 2>&1

if [ "$?" -eq 0 ] ; then
  exec /home/royroy/serviio-1.4.1.2/bin/serviio.sh -stop
else
  exec /home/royroy/serviio-1.4.1.2/bin/serviio.sh
fi
 


Just change the three lines to point to your /bin folder in the Serviio directory.

I thought somebody might like it.

All the best,
Roy