Advertisement
zcutlip

Untitled

Feb 1st, 2013
4,119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.49 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement