Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #!/bin/sh
  2. UPNPMSG=`xmldbc -g /runtime/upnpmsg`
  3. [ "$UPNPMSG" = "" ] && UPNPMSG="/dev/null"
  4. echo "[$0] GOT M-SEARCH: [$1 $2 $3 $4] ..." > $UPNPMSG
  5.  
  6. if [ -f /var/run/M-SEARCH.$2.$1.sh ]; then
  7.     echo "[$0] The /var/run/M-SEARCH.$2.$1.sh is running, so do nothing & leave." > $UPNPMSG
  8. else
  9.     xmldbc -P /etc/scripts/upnp/M-SEARCH.php -V "SEARCH_TARGET=$1" -V "TARGET_HOST=$2" -V "INF_UID=$3" -V "PARAM=$4" > /var/run/M-SEARCH.$2.$1.sh
  10.     sh /var/run/M-SEARCH.$2.$1.sh
  11.     rm /var/run/M-SEARCH.$2.$1.sh
  12. fi