OpenWrt: link QSS button to Transmission

Edit /etc/hotplug.d/button/qss file (Or something like that in the dir, if not, create it):

#!/bin/sh
if [ "$BUTTON" = "wps" ] ; then
 if [ "$ACTION" = "pressed" ] ; then
  TRANSSTATUS=$(ps | grep transmission | grep -v grep)
  if [ "$TRANSSTATUS" == "" ]; then
   /etc/init.d/transmission start
   logger -t qssbutton "Torrent start."
  else
   /etc/init.d/transmission stop
   logger -t qssbutton "Torrent stop."
  fi
 fi
fi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s